Set page in jqgrid

I have the following code to change a Jqgrid page.

function setPage() {
    $('#editGrid').setGridParam({ page: 10 }).trigger('reloadGrid');
    alert("Success");
}

I get a success message, but the page will not change. I am currently running a function in the boot part of the grid.

Any help would be appreciated.

+5
source share
1 answer

. trigger ('reloadGrid') will reload the grid to page 1. So you did setGridParam ({page: 10}), but then immediately after .trigger ('reloadGrid') updated the grid to page 1.

To set the grid to page 10, follow these steps:

$("#editGrid").trigger("reloadGrid",[{page:10}]);
+8
source

All Articles