UI Builder: Add reset button to reset all selected filters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 06:21 AM
Hello--
This is from asset workspace and the I have been modifying it via UI builder. There are filters "All location", Region(newly added by me). So if I select any value in any one of these filter then it has to be clear using a external button.
Here my requirement is to add a reset button component with the functionality that upon clicking the button, it should clear the selected filter beside it. Attaching screenshot for your reference.
What client state parameter or script or event has to achieve the above functionality.
Thanks in advance
@Community Alums
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 10:22 AM - edited 05-09-2024 10:24 AM
@Kamini07 , Once you select the flter values, there would be some state property getting set in each of those filter. On click of the CLearAll button, you need to empty that state parameters.
api.setState('filter1', []);
api.setState('filter2', []);
api.setState('filter3', []);
It should work by this.
Also make sure to clear the parFilter state parameter as well.
Please mark as correct if it helps.