AllenFang / AllenFang/react-bootstrap-table

Clear search input field and column filter input field dynamically

Offen
#2,054 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
2.2k
Forks
761
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.