Need help on Global filter reset

1 Answer 36 Views
Filter  Grid
J
Top achievements
Rank 1
J asked on 24 Nov 2021, 11:47 AM

HI,

I have implemented a button to clear all filters . On click i clear the filters object in data state and this does not clear the values entered in filter text box and clear filter button which is based on props.value .

Expected behavior : Once clear button is clicked - all filters should be reset with the filter textbox/ dropdown/Datepicker should be cleared and clear filter button in individual filter should be reset .

https://stackblitz.com/edit/react-aldgy2?file=src/app/main.js

https://react-aldgy2.stackblitz.io

 

Help me in achieving this

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 24 Nov 2021, 08:38 PM

Hello,

Thank you for providing an example demonstrating the issue.

After some debugging and clearing some of the code (to make the approach more clear) I was able to make the input to clear correctly:

Note that the input is bound to the value passed from the properties and not to a state value in the custom filter.

The same principle, which is also demonstrated in the following help topic, should be applied to all custom filter components:

 

Best Regards,
Konstantin Dikov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

J
Top achievements
Rank 1
commented on 25 Nov 2021, 06:25 AM

hi,

 

in the updated sample you shared , i still see the textbox and clear filter is not cleared

Konstantin Dikov
Telerik team
commented on 26 Nov 2021, 10:21 PM

The same issue is present for the DatePicker. Please follow the suggested approach from the documentation and the example and bound "props.value" to the filters:

            <DatePicker
              value={props.value}

Tags
Filter  Grid
Asked by
J
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or