JQGRID,过滤后获取所有行 [英] JQGRID , get all rows after filtering

查看:235
本文介绍了JQGRID,过滤后获取所有行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过滤JQgrid后,我无法获取所有行{paginated}。
我试过

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.

在小提琴示例中,如果在客户端列中键入test,则会有6个过滤结果,但第一个选项返回所有7条记录,第二条记录仅返回5条记录{即仅从第一页}。我需要显示6个过滤记录。
结果记录在控制台中。

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.

这是小提琴

推荐答案

问题的解决方案取决于您使用的网格分叉。 免费jqGrid 是基于jqGrid 4.7的分支(参见自述文件 wiki 了解更多信息)。当前版本的免费jqGrid是4.9。

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.

免费jqGrid支持 lastSelectedData 参数,您可以使用该参数代替数据到您需要的信息。请参阅演示

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

如果您必须使用旧的jqGrid版本而无法将其更新为免费的jqGrid,那么您可以按照答案。它显示了如何子类化选择内部 $。jgrid.from 类jqGrid的方法。在子类化之后,可以访问所需的信息。

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.

这篇关于JQGRID,过滤后获取所有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆