Pagination does not work for json in JqGrid

My pagination does not work when I removed loadonce: true ... but if I use loadonce: true, then my grid does not work. Any idea how I can do my pagination again.

update: is it an extension for the problem of loading data in jqGrid details from the main grid?

+4
source share
1 answer

If you remove loadonce:true and use the datatype:"json" or "datatype:xml" jqGrid option, then your server should implement pagination. The server receives some parameters that will be added to the url in case of "GET" requests or sent to the HTTP body in case of "POST" requests. These options are: rows , page , sidx , sord . For example, if the table has a column with the index β€œName” as the current sort column and rowNum: 20 , then your URL will be added using ?rows=20&page=1&sidx=Name&sord=asc . Your server should build the SELECT statement in the database, where the data is placed using ORDER BY Name asc , then split the result on pages of 20 lines per page and send the first page of results. (See Get the current URL, including Jqgrid parameters , for more information.) For PHP with MySQL on the server, see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:first_grid#php_and_mysql_example_file for an example.

Thus, in the case of loadonce:false or without the loadonce parameter, your server is responsible for sorting and pumping data . If it does not work, you should check your server code.

+11
source

All Articles