[x] v15.4.2
[x] V2.0.17
[x] Chrome
[x] 馃悰 Bug Report
I have been trying to clear the text inputs via React, but i can't find a way. The only way it works for me is via HTML elements, where i get all the "text"input elements then reset their values to nothing.
Is there a more clean way to do this? I noticed that on the Filters example that the inputs are cleared when you click the "Filter Row" button again, but i can't find the source code for that button.
Also, how does the onClearFilters() property work? I am not sure how it's even triggered.
BTW, we are not using the "toggle" feature, our filters are always displayed. Is onClearFilter linked to the toggle button?
Thanks,
Martin
Update:
So I found a hack to clear the filters by hiding/displaying the filter columns bar:
render() {
if (this.props.resetFilters) {
this.grid.setState({ canFilter: false });
setTimeout(() => this.grid.setState({ canFilter: true }), 1);
}
return (
)
It works for now, but if there are better suggestions please comment. Thanks!
I also need this. Is there a way how to clear filters text ?
The hack above causes a blink and a resize of grid which does not work for me
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.
The documentation mentions a prop on ReactDataGrid for onClearFilters, and the example even shows a function that clears the filters in the state that is passed to that prop. However, even the example doesn't have anything that would actually trigger it. The documentation on this could really be fleshed out.
Most helpful comment
I also need this. Is there a way how to clear filters text ?
The hack above causes a blink and a resize of grid which does not work for me