Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set page in jqgrid

Tags:

jqgrid

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.

like image 394
ffffff01 Avatar asked Feb 23 '12 07:02

ffffff01


1 Answers

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}]);
like image 93
Jpepper Avatar answered Sep 28 '22 02:09

Jpepper