We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Attribute rules still empty after setRules()

Hi, my code refresh the query builder every I change the treeView node.
The problem occurrers in thisscenario:

1. In the treeNode A, I create a simple query "Content starts with 'A'"

2. After that, I change the treeNode (with an empty query), so the currentQuery was change to an empty object {}, 

scope.$watch('currentQuery', function (newValue, oldValue) {
if(scope.currentQuery) { // a new node has
vm.builder.setRules(scope.currentQuery);
} else {
vm.builder.setRules({});
}
}

3. The Query Builder update and cleared the last query;

4. After that, I select the first treeNode again that contains a query ('Content start...');

5.  My code detects the changes on currentQuery and update the builder using setRules(scope.currentQuery);


6. The query builder renders my query again, but when I try to edit it, shows an error. 






Basically, the problem occurs when I create a query and save in a variable, clear using setRules({}), load the query with setRules(some query) and try to edit.




8 Replies

VK Vinoth Kumar Sundara Moorthy Syncfusion Team June 24, 2019 11:13 AM UTC

Hi Lucas, 
 
Good day to you. 
 
We have checked your requirement “To clear and load rules using setRules() method in QueryBuilder” and it was properly working in our end. For your convenience, we have prepared sample to clear the rule using setRules({}) and load the query using some variable in setRules method, 
 
 
Could you please check the above sample and get back to us if we misunderstood your requirement or you need any further assistance on this? 
 
Regards, 
Vinoth Kumar S 



LU Lucas June 25, 2019 03:03 PM UTC

Hi, unfortunally the problem still continues...

I recorded a video to demonstrate when the problem occurred.




Attachment: Querybuilder_bug_aeb726b9.rar


VK Vinoth Kumar Sundara Moorthy Syncfusion Team June 26, 2019 05:46 PM UTC

Hi Lucas,  
 
Good day to you. 
 
We have checked your attached video and please ensure the below steps, 
 
Step-1: Check the rule collection after adding the condition as demonstrated in the below video link, 
 
Step-2: After changing the rule, check the changeRule method as demonstrated in below video link, 
 
Could you please ensure the above steps demonstrated in the video and provide the details? Based on that we will validate and provide you better solution quickly. 
 
Regards, 
Vinoth Kumar S 



LU Lucas June 26, 2019 07:32 PM UTC

Before Step 1
After load the rules using setRules, the array rules contains different objects, is it normal?




Step 1


Step 2



LU Lucas July 3, 2019 02:00 PM UTC

I'm still with the problem, and I don't know why, any suggestions?


VK Vinoth Kumar Sundara Moorthy Syncfusion Team July 4, 2019 01:21 PM UTC

Hi Lucas, 
 
Good day to you. 
 
We have checked your screenshot and we have prepared video demonstration to show QueryBuilder with empty rule and updating the rule and then editing the rule in step by step.  
 
 
Could you please check the above video and provide us the video demonstration for QueryBuilder in your application in the same way?  Based on that we will check the issue and provide you better solution  
 
Regards, 
Vinoth Kumar S 



LU Lucas July 4, 2019 07:56 PM UTC

Hi,

I recorded two videos, the first I hadn't problems, but the second yes.
The bug scenearios is when I try to create a group condition after load rules.





Attachment: query_builder_bug_87e1c0a.rar


VK Vinoth Kumar Sundara Moorthy Syncfusion Team July 5, 2019 09:03 AM UTC

Hi Lucas, 
 
Thank you for sharing the video. 
 
Unfortunately, we cannot able to reproduce the reported issue “Rule not properly pushed into QueryBuilder rules collection” based on your provided video. We have demonstrated this in below video where the rule pushed into QueryBuilder rules collection properly. 
 
 
Could you please check the above video and if possible share your code snippet or issue reproducible sample? Based on that we will check and provide you better solution quickly. 
 
Regards, 
Vinoth Kumar S 


Loader.
Live Chat Icon For mobile
Up arrow icon