I'm using jqgrid 3.8.2, I'm trying to use below code to reload data from server side and show specific page, like current page. $("#mygrid").setGridParam({datatype:json}).trigger("reloadGrid",[{page:5}]); grid could load data from server properly, but always show first page instead of page 5. anybody could give me a hand on it?
Regards Simon
I suppose that you use
loadonce: true
parameter. To reload the data from the server you setdatatype
: to 'json' (I hope that you usesetGridParam({datatype:'json'})
and notsetGridParam({datatype:json})
like it is in the code fragment from the question). After the data will be loaded from the server the first page of the local data will be displayed.To solve the problem you will have to reload the grid one more time inside of
loadComplete
, but now you should reload the local grid. To have no reloading loop and to allow local paging you should verify whether the currentdatatype
is 'json':See the demo here.