Showing posts with label rows. Show all posts
Showing posts with label rows. Show all posts

how to show all rows n remove paging in jqGrid

If you want to display all the records / rows in the jqGrid and don't want to display the pagination then, you can do with the help of following code snippet. jqGrid has a configuration option rowNum, you have to set it to -1 to display all the rows in loaded grid.

jqGrid configuration Code

var jqGridObj = $('#'+tblId);

jqGridObj.jqGrid({  
            ....,
            ....,
            rowNum:-1,
            ...
            ...
            other config options,
            ..
         });


Alternate Method
Another Method to remove pager completely from jqGrid

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.

SHARE