AllenFang / AllenFang/react-bootstrap-table

Clear search input field and column filter input field dynamically

未關閉
#2,054 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
2.2k
分支
761
PR 合併指標
30 天內沒有已合併 PR

描述

> #### Current use-case

I am using default search and column filter and both search and filter change are handled remotely using `onSearchChange()` and `onFilterChange()` functions.

After reading through few existing issues, I could understand that when using remote the search change and filter change are standalone and it is on the developer on how to use them.

> #### Issue
Since the global search and filter search are handled separately now, I would want to clear the `searchField` text when the user does a column filter search (inside `onFilterChange()` func.) and vice-versa so the user is aware of this standalone behaviour.
To clear the column filter we could use `cleanFiltered()` function by specifying a `ref` to that column. But, this would fire the `onFilterChange()` and since we have many columns, it is fired for every clear filter case.
I am not aware of how to clear the global search field.

> #### Expected Solution
How to set the `searchField` text value to `""` and similarly for the column filterField value, without firing the onSearchChange or onFilterChange functions?

@AllenFang

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。