React-data-grid: Clear Filters Text Input

Created on 17 Aug 2017  路  4Comments  路  Source: adazzle/react-data-grid

Which version of React JS are you using?

  • [x] v15.4.2

    Which React-Data-Grid are you using?

  • [x] V2.0.17

    Which browser are you using?

  • [x] Chrome

    I'm submitting a ...

  • [x] 馃悰 Bug Report

    - [x] 馃挕 Feature Request

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

Question wontfix

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

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KalKhera picture KalKhera  路  3Comments

soma83 picture soma83  路  4Comments

GenoD picture GenoD  路  3Comments

JimLynchCodes picture JimLynchCodes  路  4Comments

alvaro1728 picture alvaro1728  路  4Comments