jquery easy ui datagrid pageSize no limit or dynamic

1.8k Views Asked by At

I'm using jQuery EasyUI datagrid to display some data to the user. The problem is, the datagrid can have a lot of data (don't know how much exactly). So what I would like to do is keep the pagination in my datagrid but display all the data on page 1 (so I would not have page 2, 3, 4, etc). Or, set the property pageSize of the datagrid dynamically to the total amount of data that I have in my datagrid.

Can anybody help with this please? Thanks in advance

1

There are 1 best solutions below

0
On

Mine solution was to change default pageSize list for one of those

pageList: [10,50,100,'-']

(char or string at the end) but in that solution in each event You are referring to pageSize You must check if it's not NaN. I have remote pagination and i'm using Doctrine so in PHP all the work i had to additionally is

if($this->_request->getParam('rows') && $this->_request->getParam('page')) {
        if( is_numeric($this->_request->getParam('rows')) 
         && is_numeric($this->_request->getParam('page')) ) {
            $docQuery = new Doctrine_Pager($docQuery, $this->_request->getParam('page'), $this->_request->getParam('rows'));
        }
    }

otherwise i'll ignore those params and disable pagination in backend. Oh and the last thing is to override one of grid methods to change pagination text, otherwise You'll get text like "Displaying {NaN} to {NaN} of {NaN} items".

Quickfix but works for me.