是否可以在jqGrid中进行列标题过滤? [英] Is it possible to have column header filtering in jqGrid?

查看:166
本文介绍了是否可以在jqGrid中进行列标题过滤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 jqGrid演示中查看了所有示例. a>,但无法找到列标题过滤的示例.

I've taken a look over all of the examples over at jqGrid Demos but have been unable to find an example of column header filtering.

以Excel的工作方式为例:

Take for example how Excel works:

是否可以启用这种排序方式,从而在下拉菜单中提供不同的字段列表?

Is it possible to enable this type of sorting, which gives a distinct list of fields in a drop down menu?

我注意到这个特定的答案显示它们,但理想情况下,我希望默认情况下无需在过滤器窗口中打开和设置过滤器即可.

I've noticed that this particular answer displays them, but ideally I'd like to do it by default without having to open and set filters in the filter window.

对不起,我没有任何代码可以显示,如果有的话,我希望更多地找到是/否和指针,也许还有几个简单的例子.

Sorry I don't have any code to show, I'm look more for a general yes/no and pointer if so, maybe with a couple of quick examples thrown in.

那么,我很幸运吗?

推荐答案

每个软件产品都有其自己的用户界面.您不应期望可以在另一种产品(例如jqGrid)中模拟Microsoft Excel的GUI.例如,如果单击网格的列标题(我的意思是jqGrid),则网格将按单击的列进行排序.尝试使Excel执行相同的操作,而不是选择列.这也不容易.

Every software product have its own user interface. You should not expect that one can simulate GUI of Microsoft Excel in another product like in jqGrid for example. If you click on the column header of the grid (I mean jqGrid) for example then the grid will be sorted by the clicked column. Try to make Excel to do the same instead of selection of the column. It's also not easy.

通常,一切皆有可能.我在旧答案中发布了示例,并在列标题中提供了按钮实现的示例. 另一个答案显示如何根据列中的所有不同值动态地在过滤器工具栏中构造选择或jQuery UI Autocomplete. 一个答案这一个显示如何使用Eric Hynds编写的jQuery UI MultiSelect Widget.

In general everything is possible. I posted in the old answer with an example of implementation of buttons in the column header. Another answer shows how to construct selects or jQuery UI Autocomplete in the filter toolbar dynamically based on all different values in the column. One more answer and this one shows how to use jQuery UI MultiSelect Widget written by Eric Hynds.

答案(和另一个)包含该演示,该演示 select2 插件的用法.该插件提供了非常接近Excel的功能.大概可以满足您的需求.

The answer (and another one) contains the demo which demonstrates the usage of select2 plugin. The plugin provides functionality which is very close to Excel. Probably it can be mostly close to what you need.

我希望使用参考答案中的想法可以实现您的要求.

I hope that usage of ideas from the referenced answers you can implement your requirements.

这篇关于是否可以在jqGrid中进行列标题过滤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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