Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQGRID , get all rows after filtering

I am not able to get all rows { paginated } after filtering JQgrid . I tried

  > var myData = grid.jqGrid('getGridParam', 'data'); 
var myData = grid.jqGrid('getRowData');

but first option gives all rows and these are unfiltered rows. second one returns filtered rows but only from first page.

In fiddle example if you type test in Client columns there are 6 filtered results, but first option returns all 7 records , and second one returns only 5 records { ie only from first page}. I need to show 6 filtered records. results are logged in console.

Here is fiddle

like image 956
Bhupendra Avatar asked Sep 28 '22 06:09

Bhupendra


1 Answers

The solution of the problem depend on which fork of grid you use. Free jqGrid is the fork based on jqGrid 4.7 (see readme and wiki for additional information). The current version of free jqGrid is 4.9.

Free jqGrid supports lastSelectedData parameter which you can use instead of data to the informational which you need. See the demo.

If you have to use old jqGrid version and can't update it to free jqGrid then you can follow the answer. It shows how one can "subclass" select method of the internal $.jgrid.from class of jqGrid. After the subclassing one have access to the required information.

like image 156
Oleg Avatar answered Oct 18 '22 17:10

Oleg