javascript - JQGRID , get all rows after filtering - Stack Overflow

I am not able to get all rows { paginated } after filtering JQgrid .I tried > var myData = grid.jqGr

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

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

Share Improve this question asked Jul 22, 2015 at 15:48 BhupendraBhupendra 1,28619 silver badges45 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

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.

The following loads the array with only the filtered data:

var filteredData = $("#grid")[0].addLocalData( true );

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744870718a4598246.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信