-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Querybuilder not clearing data objects on reset. #691
Comments
Can you show some code ? or better a demo ? Because clearly I don't understand. |
This is the json retrieved from 'getRules' after a 'reset' is performed and some new fields are selected. {
"condition": "AND",
"rules": [
{
"id": 1,
"field": "age",
"type": "integer",
"input": "number",
"operator": "greater",
"value": 17
},
{
"id": 1,
"field": "age",
"type": "integer",
"input": "number",
"operator": "less",
"value": 60
}
],
"data": {
"identifier": 83
},
"valid": true
} |
Ok it's the data associated to the main group. Waiting for a fix you can replace your call to "reset" to "setRules" with an empty rules set. {
"condition": "AND",
"rules": [
{
"empty": true
}
]
} and please read this for your future messages : https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown |
Thanks for the prompt reply. I will give your suggestion a try. |
That does work. Thanks! |
I am writing an application where I need to save the queries generated out of querybuilder. I am using the default format (not Mongo or SQL). I am passing my identity elements in the recommended data object on the group and rule levels. When the user clicks create to create a new rule, I call a reset at that time. However when I call the getrules for the new rules, it shows a data element from the last rule on the parent node of the rules. Unfortunately, what this ends up doing is attaching all my new rules to my old rules. I can probably find a workaround for this, but wanted to let you know. If you have any suggestions that would be great.
Thanks.
The text was updated successfully, but these errors were encountered: