views:

26

answers:

1

My pagination is not working when I removed the loadonce:true ...but if I use loadonce:true than my grid is not working. Any idea how can I get my pagination work again.

update: this is extension to http://stackoverflow.com/questions/3610173/problem-loading-data-in-details-jqgrid-from-master-grid

+1  A: 

If you remove loadonce:true and use datatype:"json" or "datatype:xml" jqGrid option then your server must implement pagination. The server receive some parameters which will be appended to the url in case of 'GET' requests or send in the HTTP body in case of "POST" requests. This parameters are rows, page, sidx, sord. For example if your table have a column with the index 'Name' as the current sort column and rowNum: 20 then your url will be appended with ?rows=20&page=1&sidx=Name&sord=asc. Your server should construct SELECT statement to the database where the data are placed with ORDER BY Name asc then divide the result in pages 20 rows per page and send back the first page of the results. (See http://stackoverflow.com/questions/3527617/get-current-url-including-parameters-of-jqgrid/3530191#3530191 for a little more information). For a PHP with MySQL on the server see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:first_grid#php_and_mysql_example_file as an example.

So in case of loadonce:false or no loadonce parameter your server is responsible for sorting and paging of the data. If it is not work you should verify your server code.

Oleg
thanks! again...can I enable pagination without the change in server side by reseting setGridParam({ rowNum: 10 })) before trigger('reloadGrid');(as you suggested in previous qu without changing anything on server side....when I am making a call at onSelectRow ...
paul
In my tests see http://www.ok-soft-gmbh.com/jqGrid/verorange.htm, http://www.ok-soft-gmbh.com/jqGrid/ClientSidePaging.htm, http://www.ok-soft-gmbh.com/jqGrid/ClientsideEditing.htm, http://www.ok-soft-gmbh.com/jqGrid/ClientsideEditing4.htm either there are no problem with paging or it could be fix with setting `rowNum` or `page` parameter.
Oleg