AllenFang / AllenFang/react-bootstrap-table

Clear search input field and column filter input field dynamically

Aperta
#2,054 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.2k
Fork
761
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

> #### 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.