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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

QueryBuilder ODataV4

Thread ID:

Created:

Updated:

Platform:

Replies:

149121 Nov 15,2019 05:35 AM UTC Dec 2,2019 05:08 AM UTC React - EJ 2 3
loading
Tags: Query Builder
raouf
Asked On November 15, 2019 05:35 AM UTC

Hello,

Is it possible to use the query builder with a DataManager based on an ODataV4 DataAdapter?

If, yes, what should I set the dataSource of the query builder to in JSX?

Currently I have a Grid whose DataSource is bound to the data manager. Everything is fine on that side. 

When I add the query builder with the datasource set to the same one as the grid, it dosen't show up (the query builder). On the console I get the following error
     adaptors.js:600 Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at ODataV4Adaptor.UrlAdaptor.processQuery (adaptors.js:600)
    at DataManager.executeLocal (manager.js:143)
    at QueryBuilderComponent.QueryBuilder.render (query-builder.js:2901)
    at QueryBuilderComponent.render (querybuilder.component.js:54)
    at QueryBuilderComponent.Component.appendTo (component.js:185)
    at QueryBuilderComponent.ComponentBase.renderReactComponent (component-base.js:94)


When I set the dataSource to null it shows up but when the ruleChange event fires and try the same code as your public demo(although with a different set of columns) Iget 2 errors. The first's stack tract is : 
Uncaught TypeError: Cannot read property 'toJson' of null
    at ODataV4Adaptor.UrlAdaptor.processQuery (adaptors.js:524)
    at DataManager.executeQuery (manager.js:200)
    at Data.executeQuery (data.js:467)
    at Data.insert (data.js:449)
    at Data.getData (data.js:439)
    at Render.refreshDataManager (render.js:224)
    at Observer.<anonymous> (render.js:130)
    at Observer.notify (observer.js:131)
    at GridComponent.ComponentBase.trigger (component-base.js:198)
    at Render.refresh (render.js:97)
    at GridComponent.Grid.refresh (grid.js:2329)
    at QueryBuilderComponent.ListComponent.queryBuilderRuleChange (ListComponent.js:131)
    at Observer.notify (observer.js:127)
    at QueryBuilderComponent.ComponentBase.trigger (component-base.js:198)
    at QueryBuilderComponent.QueryBuilder.filterRules (query-builder.js:2249)
    at QueryBuilderComponent.QueryBuilder.updateRules (query-builder.js:2233)
    at QueryBuilderComponent.QueryBuilder.changeValueSuccessCallBack (query-builder.js:1177)
    at Observer.<anonymous> (query-builder.js:1168)
    at Observer.notify (observer.js:109)
    at QueryBuilderComponent.ComponentBase.trigger (component-base.js:198)
    at QueryBuilderComponent.QueryBuilder.filterValue (query-builder.js:1167)
    at QueryBuilderComponent.QueryBuilder.changeValue (query-builder.js:1150)
    at Observer.notify (observer.js:127)
    at TextBox.Base.trigger (base.js:184)
    at TextBox.inputHandler (textbox.js:531)

The second's stacktrace is :

adaptors.js:524 Uncaught TypeError: Cannot read property 'toJson' of null
    at ODataV4Adaptor.UrlAdaptor.processQuery (adaptors.js:524)
    at DataManager.executeQuery (manager.js:200)
    at Data.executeQuery (data.js:467)
    at Data.insert (data.js:449)
    at Data.getData (data.js:439)
    at Render.refreshDataManager (render.js:224)
    at Observer.<anonymous> (render.js:130)
    at Observer.notify (observer.js:131)
    at GridComponent.ComponentBase.trigger (component-base.js:198)
    at Render.refresh (render.js:97)
    at Observer.notify (observer.js:127)
    at GridComponent.Component.notify (component.js:265)
    at GridComponent.Grid.onPropertyChanged (grid.js:1210)
    at GridComponent.Base.dataBind (base.js:124)
    at GridComponent.Component.dataBind (component.js:211)
    at messageHandler (util.js:42)

Can you help with this?

Madhan Venkateshan [Syncfusion]
Replied On November 20, 2019 05:25 PM UTC

Hi Raouf, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query and we cannot able to reproduce the reported issue. We have prepared a sample based on ODataV4 DataAdapter for both querybuilder and grid, please check with below sample to resolve the issue at your end, If the issue still persist, could you please replicate the issue in the attached sample link. 
 
 
 
Regards, 
Madhan V 


raouf
Replied On November 29, 2019 08:35 AM UTC

Hello,

Thank you for you answer.

The problem is now solved. 

It seems it was caused by incompatible versions between the required ones required to make this work.

After cleaning the node_modules folder, the query builder works fine.

Madhan Venkateshan [Syncfusion]
Replied On December 2, 2019 05:08 AM UTC

Hi Raouf, 
 
Thanks for you update. 
  
We are happy to hear that your reported issue has been resolved. Please feel free to contact us if you need any further assistance on Syncfusion components. 
  
Regards, 
 Madhan V

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon