react-querybuilder icon indicating copy to clipboard operation
react-querybuilder copied to clipboard

Clear all button needed

Open anwin-aot opened this issue 4 years ago • 2 comments

Hi @jakeboone02 ,

In my project I'm using react-querybuilder. I need a "clear all" button to remove all the filters I'm used. If I used 10 filter, I need to use close button for 10 times to clear all filters for now. Can you please update me on this?

anwin-aot avatar Jun 10 '22 06:06 anwin-aot

Does the button need to be on the query builder itself, or can it be outside? If the former, you could augment one of the standard components to show a "clear all" button in addition to the normal one. If the latter, you could render a button that resets the query to {combinator:"and",rules:[]} in its onClick handler.

jakeboone02 avatar Jun 10 '22 07:06 jakeboone02

Thank you for your prompt response. @jakeboone02

anwin-aot avatar Jun 10 '22 07:06 anwin-aot