I am using query builder and creating the columns with templates. The templates cause a crash when trying to change the value. The column itself has field, label, operator, and type values as well as the template. Is there some kind of prop that I need to use to get the template function working? I'm using https://ej2.syncfusion.com/react/documentation/query-builder/templates/#using-template to create the template, but I'm still getting these errors. The only time I get this error is when I try to capture the new rule values in the ruleChange or change prop for QueryBuilderComponent.
Hi Juliet,
We are unable to replicate the issue in our end. We have prepared the sample based on your requirement. Please refer the below sample link.
Sample link: https://stackblitz.com/edit/react-xstvmz?file=index.js
If you still facing the issue, please share the below details.
Share the issue reproducible sample or replicate the issue in our sample.
Share the video demonstration of issue replicable.
Please provide the above requested information, based on that we will check and provide you a better solution quickly.
Regards,
YuvanShankar A
Hello, the issue that I'm having is with Template not ruleTemplate. Here is an example of the code that I am using.
Hi Juliet,
We have prepared the sample based on your provided code snippet. but still, we can’t reproduce your reported query. Please refer the below sample link.
Sample link: https://stackblitz.com/edit/react-xstvmz-56utxn?file=index.js
If you still facing the issue, please share the issue reproducible sample or replicate the issue in our sample, based on that we will check and provide you a better solution quickly.
Regards,
YuvanShankar A
It looks like part of the problem might be that I'm using material ui components along side syncfusion. I removed those, and it looks like the value part works just fine, but I do still get this error when changing operator values.
https://stackblitz.com/edit/react-xstvmz-mxzoh4?file=index.js
I was able to get a copy with the bug on stackBlitz, please take a look.
https://stackblitz.com/edit/react-xstvmz-mxzoh4?file=index.js,data-source.js,index.html
This contains the error with the value template change and the issue with the operator change
Hi Juliet,
We have validated your reported query and found an issue in your provided sample code. Please ensure the below mentioned line, this is reason for script error. This line makes query builder rule empty for every change in query builder.
[index.js]:
|
<QueryBuilderComponent ref={ref} id={id} dataSource={dataSource} columns={columns} rule={!value || typeof value !== 'object' ? value : value} change={handleRuleChange} sortDirection="Ascending" {...props} ></QueryBuilderComponent> |
Without the above-mentioned line, sample working fine. Please refer the below sample link.
Sample link: https://stackblitz.com/edit/react-3uugqq?file=index.js
Could you please check with above sample and get back to us, if you need any further assistance on this.
Regards,
YuvanShankar A
Hello,
I made that change, but I'm still having the same issue. It looks like you removed template in that link, and that's the part that seems to be causing the issue. Here is an example of replacing the value and it still not working.
https://stackblitz.com/edit/react-3uugqq-5gnd4m?file=index.js,index.html
Hi Juliet,
We have validated your reported query and please remove the below highlighted line. The rule property used for initial loading rule for query builder. But in your provided sample, change event trigger for every value change in query builder and every time setting empty rule to the query builder. It is reason for your script error. Please ensure the below code snippet.
[index.js]:
|
<QueryBuilderComponent ref={ref} id={id} dataSource={dataSource} columns={columns} rule={value} change={handleRuleChange} sortDirection="Ascending" {...props} ></QueryBuilderComponent> |
Without the above-mentioned line, sample working fine. Please refer the below sample link.
Sample link: https://stackblitz.com/edit/react-3uugqq-kprjtg?file=index.js
Could you please check with above sample and get back to us, if you need any further assistance on this.
Regards,
YuvanShankar A