ffffff01
ffffff01

Reputation: 5238

Set page in 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.

Upvotes: 6

Views: 19366

Answers (1)

Jpepper
Jpepper

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

Related Questions