有没有办法在 jquery jqgrid 中以编程方式设置过滤器? [英] is there a way to programatically set a filter in jquery jqgrid?

查看:17
本文介绍了有没有办法在 jquery jqgrid 中以编程方式设置过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,上面有一个 jqgrid,顶部有过滤器行.我想在加载此网格页面但在其中一列上设置过滤器的另一个页面上有一个链接.是否可以通过链接或人们可以建议的任何其他解决方法来做到这一点?

i have a page with a jqgrid on it with filter row at the top. I want to have a link on another page that loads this grid page but with a filter set on one of the columns. is that possible to do from a link or any other workaround people can suggest?

推荐答案

我解决这个问题的方法是传入以下代码:

the way i solved this was to pass in the following code:

var myfilter = { groupOp: "AND", rules: [] };
myfilter.rules.push({ field: "DataIssuesYN", op: "eq", data: "Y" });

然后在 jqGrid 设置中,我传入 postData:

and then in the jqGrid setup, I pass into postData:

  postData: (myfilter) ? { filters: JSON.stringify(myfilter)} : {},

这篇关于有没有办法在 jquery jqgrid 中以编程方式设置过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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