Skip to content

Commit bd623d8

Browse files
committed
Fix #691 : clear root data, flags and condition on reset
1 parent 6665e9b commit bd623d8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

examples/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ <h3>Output</h3>
552552
flags: {
553553
condition_readonly: true
554554
},
555+
data: {
556+
root: true
557+
},
555558
rules: [{
556559
id: 'price',
557560
operator: 'between',

src/public.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ QueryBuilder.prototype.reset = function() {
4646

4747
this.model.root.empty();
4848

49+
this.model.root.data = undefined;
50+
this.model.root.flags = $.extend({}, this.settings.default_group_flags);
51+
this.model.root.condition = this.settings.default_condition;
52+
4953
this.addRule(this.model.root);
5054

5155
/**

0 commit comments

Comments
 (0)