首页 > 解决方案 > AG-Grid Enterprise: How to replace Column Menu by community filter

问题描述

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.

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).

Maybe by specifying some menuTabs options... but the doc doesn't help on what is the options available for these menu.

Here is an example of the simple column filter (the functionnality wanted): https://plnkr.co/edit/HougMsUWbIU2Plhd9rRz?p=preview

Here is an example with the "entreprise filter" (the functionnality that I don't want): https://plnkr.co/edit/wg6cpAVn7t7rrbX143ug?p=preview

Thanks a lot,

标签: ag-grid

解决方案


您可以在内部指定filtercolumnDefs

agNumberColumnFilter 用于数字比较的数字过滤器。

agTextColumnFilter 用于字符串比较的文本过滤器。

agDateColumnFilter 用于日期比较的日期过滤器。

agSetColumnFilter 设置筛选器,受 Microsoft Excel 中筛选器工作方式的影响。这是 ag-Grid-Enterprise 功能。

要获得简单的过滤器,您可以使用: agNumberColumnFilter, agTextColumnFilter, agDateColumnFilterwith menuTabs:['filterMenuTab'], 在这种情况下其他选项卡将被抑制。

或者你可以floatingFilter使用属性suppressMenu gridOptions

例如:

filter: 'agNumberColumnFilter',  menuTabs:['filterMenuTab']

或者:

gridOptions.floatingFilter: true
....
filter:'agNumberColumnFilter', suppressMenu: true

推荐阅读