AG-Grid Enterprise:如何通过社区过滤器替换“列菜单” [英] AG-Grid Enterprise: How to replace Column Menu by community filter
问题描述
我正在尝试Ag-Grid的企业版,但是使用该版本时,我无法使用标准的列过滤器。
它只有一个带有过滤功能的列面板,但是,此面板更难使用。
I'm trying the entreprise version of Ag-Grid, but when using this version I can not have the standard "column filter". It only have a "Columns panels" with a filtering but, this one is more difficult to use.
有没有办法获得社区版本列过滤器,当使用ag-grid企业版(我需要一些其他功能)时。
Is there any way to have the community version of column filter, when using the ag-grid entreprise version (that I need for some other functionnality).
也许通过指定一些 menuTabs
选项...,但是文档对这些菜单可用的选项没有帮助。
Maybe by specifying some menuTabs
options... but the doc doesn't help on what is the options available for these menu.
以下是简单列过滤器的示例(需要的功能):
https://plnkr.co/edit/HougMsUWbIU2Plhd9rRz?p = preview
Here is an example of the simple column filter (the functionnality wanted): https://plnkr.co/edit/HougMsUWbIU2Plhd9rRz?p=preview
以下是企业过滤器(我不想要的功能)的示例:
https://plnkr.co/edit/wg6cpAVn7t7rrbX143ug?p=preview
Here is an example with the "entreprise filter" (the functionnality that I don't want): https://plnkr.co/edit/wg6cpAVn7t7rrbX143ug?p=preview
非常感谢
推荐答案
您可以指定 过滤器
在 columnDefs
中的值:
agNumberColumnFilter
用于数字比较的数字过滤器。
agNumberColumnFilter
A Number Filter for number comparisons.
agTextColumnFilter
用于字符串比较的文本过滤器。
agTextColumnFilter
A Text Filter for string comparisons.
agDateColumnFilter
用于日期比较的日期过滤器。
agDateColumnFilter
A Date Filter for date comparisons.
agSetColumnFilter
设置过滤器,受过滤器在Microsoft Excel中的工作方式的影响。这是一个ag-Grid-Enterprise功能。
agSetColumnFilter
A Set Filter, influenced by how filters work in Microsoft Excel. This is an ag-Grid-Enterprise feature.
要获得简单的过滤器,可以使用: agNumberColumnFilter
, agTextColumnFilter
, agDateColumnFilter
和 menuTabs:['filterMenuTab']
,在这种情况下,其他选项卡将被取消。
To get the simple filter you can use: agNumberColumnFilter
, agTextColumnFilter
, agDateColumnFilter
with menuTabs:['filterMenuTab']
, on this case other tabs would be suppressed.
或者您可以使用 floatingFilter
与 suppressMenu
gridOptions
属性
Or you can use floatingFilter
with suppressMenu
gridOptions
property
例如:
filter: 'agNumberColumnFilter', menuTabs:['filterMenuTab']
或:
gridOptions.floatingFilter: true
....
filter:'agNumberColumnFilter', suppressMenu: true
这篇关于AG-Grid Enterprise:如何通过社区过滤器替换“列菜单”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!