Finding current page number in jqGrid

Ron Harlev picture Ron Harlev · Aug 29, 2009 · Viewed 26.2k times · Source

How can I find the current page number in jqGrid (using jQuery of course). Also how do I know how many pages are there in total.

Answer

Andy Gaskell picture Andy Gaskell · Aug 29, 2009

This should do it:

$("#sp_1").text(); // total pages

$(".ui-pg-input").val(); // current page

Edit: I found a better way in the docs for the current page but I didn't see anything for the total page count. (Click Manipulating -> Get Methods)

$('#your_grid').getGridParam('page'); // current page