Reputation: 5238
I've got the following code to change the page of the Jqgrid.
function setPage() {
$('#editGrid').setGridParam({ page: 10 }).trigger('reloadGrid');
alert("Success");
}
I get the success message but the page wont change. Currently I run the function in the loadcomplete section of the grid.
Any help would be appreciated.
Upvotes: 6
Views: 19366
Reputation: 437
The .trigger('reloadGrid') will reload the grid to page 1. So you did setGridParam({page:10}) but then right after .trigger('reloadGrid') refreshed the grid to page 1.
To set the grid to page 10 do this:
$("#editGrid").trigger("reloadGrid",[{page:10}]);
Upvotes: 9