Query Builder - Toggling boolean to false does not update SQL query in ruleChange event

Hello,

I have implemented the QueryBuilder with a method for the ruleChange event that is supposed to use getSqlFromRules to display the SQL query in a separate div on the page. 

However, when I create a boolean condition and try to set the value to False, I am not getting the updated SQL query. The same thing happens if I try to select a different boolean field and set that to either value.

I see the following errors in the log, maybe they are related?

Image_5216_1691419375880

Thank you,

KS


4 Replies

YA YuvanShankar Arunagiri Syncfusion Team August 8, 2023 12:42 PM UTC

Hi KS,


We have attempted to replicate the issue on our end but were unable to do so. We have prepared a sample based on your provided information and to show how QueryBuilder returns SQL query from ruleChange event component without any error on our end.


Sample link: https://stackblitz.com/edit/angular-fuo8mm?file=src%2Fapp.component.html


If still you’re facing the issue, please share the issue replicable sample or replicate the issue on our sample with replication steps. Based on that we will check and provide you a better solution quickly.


Regards,

YuvanShankar A



KS KS August 8, 2023 01:58 PM UTC

Hello,

The sample link you provided has nothing to do with the Query Builder, which is what I am having an issue with.

Here is a sample I have altered to show the issue: https://stackblitz.com/edit/angular-unapaj-3phuo9?file=app.component.html,app.component.ts,app.component.css,app%2Fapp.module.ts

Please follow the below steps to see what I mean:

  1. Add a new condition for Employee > Is Active. 
  2. Open the console to see the output. ​It should display "Employee.IsActive = true".
  3. Now, toggle the value to false.
  4. Issue #1​ - Observe the error in the console instead of the expected query.
  5. Add another condition, this time selecting Employee > Is VIP.
  6. Issue #2​ - The condition in the console still has Employee.IsActive set to true, when it was supposed to be false.
  7. Issue #3​ - Changing either of the values at this point will result in the same getDataByValue error, no matter what the values are set to.

Please see below for the screenshot of the errors that occur following the above steps (up to step 6):

Image_4500_1691502558111

And this is what happens when the value is toggled to anything else after this point:

Image_6401_1691502727857


Thank you,

KS



YA YuvanShankar Arunagiri Syncfusion Team August 9, 2023 09:57 AM UTC

KS,


We have confirmed the issue as script error thrown while changing Boolean value in dropdowntree fieldMode of QB" and logged a defect report. We will include the fix for this issue in upcoming weekly patch release scheduled for 16th of August 2023.


You will be informed regarding this once the fix is published.


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”



KV Keerthikaran Venkatachalam Syncfusion Team August 17, 2023 09:30 AM UTC

Hi KS,


We are glad to announce that our weekly patch release (22.2.9) has been rolled out. We have included the fix for this script error thrown while changing Boolean value in dropdowntree fieldMode of QB issue in this release. So, we suggest you upgrade our Syncfusion packages to our latest version to resolve this issue on your end (22.2.9).

Release notes: https://ej2.syncfusion.com/angular/documentation/release-notes/22.2.9/?type=all#querybuilder 

Sample link: https://stackblitz.com/edit/angular-unapaj-cnfr3t?file=app.component.html

Package link: https://www.npmjs.com/package/@syncfusion/ej2-angular-querybuilder


Loader.
Up arrow icon