Angular-QueryBuilder icon indicating copy to clipboard operation
Angular-QueryBuilder copied to clipboard

How do we reset the query builder to default value?

Open karthikchintala64 opened this issue 5 years ago • 1 comments

Is there any helper method to reset/clear the query builder?

karthikchintala64 avatar May 12 '20 09:05 karthikchintala64

They only two method allower are removeRule and removeRuleSet, you could make a reset/clear button with click event like this.

HTML Example

<query-builder [formControl]='queryCtrl'></query-builder>

queryCtrl is a FormControl

Example of reset :

reset() {
    this.queryCtrl.setValue({
      condition: 'and',
      rules: []
    })
  }

negolas avatar May 13 '20 07:05 negolas