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
  • 16,227
  • 24
  • 89
  • 132

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
  • 131,333
  • 52
  • 229
  • 284
Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273
  • 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
  • 24,179
  • 5
  • 44
  • 125
amernov
  • 626
  • 1
  • 8
  • 18