简体   繁体   中英

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

I am trying to use Apply and Reset button with agSetColumnFilter in my application but it does not work as expected.

Scenario: When we try to add some text in the search box and click on Apply it does not filter. I have added a link feel free to modify.

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

在此处输入图像描述

According to AgGrid documentation, If you want the same behavior then you have to add 'excelMode': 'windows' in the filterParams.

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

Below links are given for your reference.

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

Working code as expected: https://plnkr.co/edit/iZQa3eeJu807zlj3?preview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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