ag-grid - 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,
解决方案
您可以在内部指定filter
值columnDefs
:
agNumberColumnFilter
用于数字比较的数字过滤器。
agTextColumnFilter
用于字符串比较的文本过滤器。
agDateColumnFilter
用于日期比较的日期过滤器。
agSetColumnFilter
设置筛选器,受 Microsoft Excel 中筛选器工作方式的影响。这是 ag-Grid-Enterprise 功能。
要获得简单的过滤器,您可以使用: agNumberColumnFilter
, agTextColumnFilter
, agDateColumnFilter
with menuTabs:['filterMenuTab']
, 在这种情况下其他选项卡将被抑制。
或者你可以floatingFilter
使用属性suppressMenu
gridOptions
例如:
filter: 'agNumberColumnFilter', menuTabs:['filterMenuTab']
或者:
gridOptions.floatingFilter: true
....
filter:'agNumberColumnFilter', suppressMenu: true
推荐阅读
- django - django 2.1 在从管理面板添加新项目时执行功能
- java - Java中的暂停和恢复动画(thread.sleep)
- python - 如何将 python 脚本压缩为 exe(及其必要的文件)
- swift - 扫描 BLE 外围设备并连接到它
- android - 当我输入一封信以注册/登录活动时,我的应用程序崩溃
- ios - pickerView 的 Swift 4 selectRow 在 viewDidAppear 中不起作用
- css - 如何填充或描边 svg sprite 中的 svg 元素。
- mongodb - Scala和mongodb不同的模型版本
- c# - 带有 HTTP 2.0 的 RestSharp
- c# - 我需要一个解决方案来消除类中的公共字符串