5

Is there a jqGrid method that will skip to the next/prev page of rows. I was trying to programmatically click the button itself with jQuery, but didn't succeed yet

Ron Harlev
  • 15,653
  • 24
  • 85
  • 128

2 Answers2

7

To go to page 123:

grid = $("#grid");
grid.setGridParam({
    page: 123
});
grid.trigger("reloadGrid");

NB: The grid behaves oddly if you go to a page for which there is no data.

Justin Ethier
  • 127,537
  • 50
  • 225
  • 279
Craig Stuntz
  • 124,853
  • 12
  • 249
  • 270
  • Can I find the current page number, so I can use N+1 as the next page number. Also how do I know how many pages are there in total – Ron Harlev Aug 28 '09 at 22:03
  • 1
    $("#grid").jqGrid('getGridParam','page') returns current page and $("#grid").jqGrid('getGridParam','lastpage') returns the total number of pages. – Andrea Dec 17 '14 at 17:42
-2

You can use $("#next").click(); to trigger next page.

Mr.Wizard
  • 23,949
  • 5
  • 42
  • 119
amernov
  • 596
  • 1
  • 5
  • 18