JqGrid refreshes the current page

I am trying to get a jqGrid table to keep the current page on reload. I found some samples, but they don't seem to work for me. Here is what I am trying:

grid.setGridParam({datatype:'json'}).trigger('reloadGrid',[{page:currentPage}]);

It updates, but always redraws the first page.

+4
source share
3 answers

To keep the page redrawn, just use this:

grid.trigger("reloadGrid",[{current:true}]);

As an interest, you can also get the current page using:

var currentPageVar = grid.getGridParam('page');

Addition:

'grid' is defined this way:

var grid = jQuery("#grid");

Which refers to the grid table id in HTML.

0
source

you can just use this code:

 jQuery("#your_id").trigger("reloadGrid");
0
source

grid.trigger("reloadGrid", {page: currentPage, fromServer: true});

grid.trigger("reloadGrid", {current: true, fromServer: true});

free jqGrid. forceClientSorting: true loadonce: true.

, , : jqGrid , . loadonce: true, jqGrid . , , . forceClientSorting: true jqGrid , ( ) . forceClientSorting: true ( ), ( ), .

0
source

Source: https://habr.com/ru/post/1528791/


All Articles