0

After setting loadonce to false multiple search for jqgrid , it is not loading the searched data. It is reloading the grid with all the data.

Heena
  • 1
  • 1

1 Answers1

1

The server should returns different data depend on whether you use loadonce: true or default loadonce: false option. It seems that your server part provide incorrect data for loadonce: false.

For understanding. jqGrid send to server some parameters. It's default names are page, rows, sidx, sord, _search and additional parameters in case of filtering. In case of Advanced Searching its parameter filters.

To implement correctly server part in case of usage loadonce: true one need just use sidx and sord input parameters and returns all data which need be just sorted corresponds to values of sidx and sord parameters.

To implement correctly server part in case of usage loadonce: false you need implement more sophisticated logic on the server side. The server should filter the data based on filters parameter (if _search is set), the results of filtering should be sorted by sidx and sord and the final results have to be divided on pages of size rows and the page specified by page parameter should be returned to the server. So only one page of filtered data should be returned by the server. In other words you have to implement filtering, sorting and paging of data on the server side if you don't want to use loadonce: true.

The old answer provides an example of such implementation on ASP.NET MVC.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798