向ExtJS GridPanel添加过滤器标题行 [英] Adding a filter header row to ExtJS GridPanel

查看:243
本文介绍了向ExtJS GridPanel添加过滤器标题行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以在列标题中添加一个过滤器行,因为我已经用Coolite看完了。但是,由于我是Sencha(ExtJS)的全新手,我无法找到如何使用ExtJS.grid.GridPanel直接在脚本中执行此操作。你可以指出我正确的方向吗?

I know that it's possible to add a filter row UNDER the column title because I've seen it done with Coolite. But since I'm a total newbie with Sencha (ExtJS), I have trouble finding how to do it with the ExtJS.grid.GridPanel directly in the script. Would you point me in the right direction with some samples please ?

如果可能,我想这样做没有插件,但如果有一个在那里做得很好,很容易使用,我可以改变主意。

If possible, I would like to do so without plugins, but if there's one out there doing great and easy to use, I could change my mind.

谢谢!

推荐答案

在此您可以链接到 GridHeaderFilters 插件。你有一个简单的例子,如何使用它。

Here you have a link to the GridHeaderFilters Plugin. There you have an easy example of how to use it.

关于你的评论,试图做这个没有插件,我建议你不要这样做。因为这可能是一个简单的代码写,但我相信它不是。这就是为什么这个插件有数百行。我认为这不是一个你不会使用的功能的插件,这个插件只是按照你需要的方式进行过滤。

And regarding your comment about trying to do this without a plugin I recommend you not to do it. Because this might seem like a easy code to write but I believe it is not. And that is why this plugin has hundreds of lines. I think this is not a plugin full of features that you won't use, this plugin just does the filtering the way you need it.

作为最后一个注释,如果您期待与这个coolite示例完全相同的行为,我认为你没有运气。因为如果您获得该示例的JavaScript源代码并通过 jsbeautifier 运行,那么您将看到此示例未使用任何ExtJS插件,并不是一个简单的代码,因为使用一个非常复杂的标题头。

And as a final note, if you are expecting the exact same behavior as in this coolite example I think you are out of luck. Because if you get the javascript source code of that example and run it through jsbeautifier you will see that this example is not using any ExtJS plugin and is not a easy code as is using a really complex template for the headers.

这篇关于向ExtJS GridPanel添加过滤器标题行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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