Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get row count for jqGrid?

Tags:

I would like to know how to get row count for jqGrid. I'm using rowNum: -1 so it displays all the rows. I tried using:

parseInt($("#grid").getGridParam("records"), 10) 

But it always returns 0.

Thanks for the help.

like image 656
developer Avatar asked Apr 06 '10 19:04

developer


2 Answers

Try:

$("#grid").getGridParam("reccount") 

from the jqGrid documentation:

reccount (integer):

Readonly property. Returns the exact number of rows in the grid


Note also that, as Mike commented, you need to use the getGridParam method with the records option to retrieve a count of all the rows if you are using pagination.

like image 134
Justin Ethier Avatar answered Oct 09 '22 17:10

Justin Ethier


jQuery("#grid").jqGrid('getGridParam', 'records'); 
like image 30
dzona Avatar answered Oct 09 '22 17:10

dzona