AG-Grid Enterprise: How to replace Column Menu by community filter

核能气质少年 提交于 2019-12-11 18:41:47

问题


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,


回答1:


You can specify filter value inside columnDefs :

agNumberColumnFilter A Number Filter for number comparisons.

agTextColumnFilter A Text Filter for string comparisons.

agDateColumnFilter A Date Filter for date comparisons.

agSetColumnFilter A Set Filter, influenced by how filters work in Microsoft Excel. This is an ag-Grid-Enterprise feature.

To get the simple filter you can use: agNumberColumnFilter, agTextColumnFilter, agDateColumnFilter with menuTabs:['filterMenuTab'], on this case other tabs would be suppressed.

Or you can use floatingFilter with suppressMenu gridOptions property

As example :

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

Or:

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


来源:https://stackoverflow.com/questions/52475553/ag-grid-enterprise-how-to-replace-column-menu-by-community-filter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!