Showing posts with label pager. Show all posts
Showing posts with label pager. Show all posts

how to remove pagination from jqGrid

If you set rowNum = -1 in jqGrid configuration options then it will display all records instead of dividing rows in no of pages. But this configuration keeps the pagination HTML as it is there in bottom or top toolbar. To remove it completely from jqGrid then we have to delete that HTML with help of jQuery and dom operations. Take a look at following code to remove the pagination from jqGrid completely.

jqGrid configuration Code

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

jqGridObj.jqGrid({  
            ....,
            ....,
            rowNum:-1,   // this loads all the records.
            ...
            ...
            other config options,
            gridComplete: function(){
              // this line removes the HTML of pagination 
              $('#pager'+jqGridObj[0].id+'_center').hide();
            },
            ..
         });

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

SHARE