how to count number of rows in jqGrid - reccount

jqGrid is really a very nice and easiest tool to integrate datagrid. It also has lots of functions so that we can customize it as per our needs and as per my knowledge we can do almost any thing with it. If you want to count the number of rows in a jqGrid then you can simply use the following code.
JS Code

var jqGridObj = $('#gridTableId');
alert(jqGridObj.getGridParam("reccount"));

For old version of jqGrid
jqGridObj .jqGrid('getGridParam', 'records');

Explanation
getGridParam added in new version of jqGrid, we can use it to read any property of the loaded grid with the help of object. In our example jqGridObj is object. We can pass the variable which we want to retrive from loaded grid. In above example we need to retrieve number of rows in jqGrid, so we have specified "reccount" as a parameter to the function.

0 comments:

Post a Comment

Ask queries, report bugs, send enhancements and tips that you have experienced.

SHARE