Reputation: 25
could anyone tell me how to implement client side paging on jqgrid? Currently, my pager just shows one page which is an error. However, if I change the number of records per page using the drop down, the grid is updated accordingly. But I am unable to navigate thru the pages. Thanks in advance
Upvotes: 1
Views: 1289
Reputation: 221997
I suppose that you fill the grid in the wrong way. You don't included any code in your question, so I can only guess that you use addRowData
method to fill the grid. If it's so, then you should know that the usage of addRowData
method it the worst and the slowest way to fill the grid which I know.
The best way in case of datatype: 'local'
is to use data
option of jqGrid in combination with gridview: true
. It sorts the data from the data
parameter corresponds with sortname
and sortorder
options, create jqGrid and display the first page of the grid (the size of the page defines rowNum
option). The value of data
parameter should be array of items which represent the grid rows. Every item should contains properties with the names like the name
property of colModel
. Additionally every item of data
should contains id
property which unique value will be used as id
attribute of rows (id
of <tr>
elements).
Upvotes: 0