繁体   English   中英

为什么应用按钮在 Ag-grid 过滤器 (agSetColumnFilter) 中不起作用?

[英]Why Apply Button does not Work in Ag-grid Filter (agSetColumnFilter)?

我正在尝试在我的应用程序中使用带有 agSetColumnFilter 的应用和重置按钮,但它没有按预期工作。

场景:当我们尝试在搜索框中添加一些文本并单击应用时,它不会过滤。 我添加了一个链接,可以随意修改。

    { field: 'country', filter: 'agSetColumnFilter', 
      filterParams: {
          buttons: ['reset', 'apply']
      }
    }

在此处输入图像描述

根据 AgGrid 文档,如果您想要相同的行为,则必须在 filterParams 中添加'excelMode': 'windows'

columnDefs: [
  // set filters
  { 
    field: 'athlete',
    filter: true,
    filterParams: {
      buttons: ['reset', 'apply'],
      excelMode: 'windows',
    },
  },
]

以下链接供您参考。

https://www.ag-grid.com/javascript-data-grid/filter-set-excel-mode/#example-excel-mode

按预期工作代码: https ://plnkr.co/edit/iZQa3eeJu807zlj3?preview

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM