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
close icon

Error on ODataV4Adaptor

Hello,

I have been struggling with for 2 days now. So, any kind of help would be appreciated.

The problem is that when using Grid with a DataManger (OData, ODataV4 or Url) based dataSource the binding doesn't work. The dataBound event gets fired but not dataSourceChanged.

The thing is in render (inside a class based component) I used the dataManger instance to query the API. It works.

The error is : TypeError: dm.dataSource.url is undefined. It is thrown from adaptor.js line 596.

5 Replies

PS Pavithra Subramaniyam Syncfusion Team November 8, 2019 08:54 AM UTC

Hi raouf, 

Greetings from Syncfusion support. 

We have tried to reproduce the reported issue at our end but is working fine at our end. We have prepared a sample for your reference. 


and we suspect that the duplicate packages might be installed in your application. Please check and ensure whether the node_modules contains the duplicate Syncfusion packages or not . If duplicate packages present inside the Syncfusion packages (ex: node_modules inside ej2-react-grids package)then remove that package manually or you can update the packages using the below way.  

Please refer the below help documentation for more information. 


Regards, 
Pavithra S. 



RA raouf November 8, 2019 01:20 PM UTC

Thanks for the answer.

The docs section about npm packages update was helpful.


PS Pavithra Subramaniyam Syncfusion Team November 11, 2019 04:42 AM UTC

  
Hi raouf, 
 
Thanks for your update. 
 
We are happy to hear that the provided documentation has helped you. 
 
Please get back to us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 



MN Mehdi Nabhani replied to Pavithra Subramaniyam April 8, 2023 01:21 AM UTC

I am facing this exact same problem but cannot fix it for 2 days now. What can i do? The dataserver is running locally and does not even get contacted.

when i apply the query and the result of the query to the grid as datasource, it shows the items. but for server side paging, over 27.000 items,.... i want to apply the datamanager as a dataource and then i get this error. 


const data = new DataManager({
url: "http://localhost:5050/api/level/levels",
adaptor: new ODataV4Adaptor(),
logGroup: "DataManager",
});

setDataSource(data);

and the logGroup does not work, not sure if it should work this way.


adaptors.js:625 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')

    at UrlAdaptor.processQuery (adaptors.js:625:35)

    at e.executeLocal (ej2-data.min.js:10:74366)

    at ej2-data.min.js:10:75536

UrlAdaptor.processQuery @ adaptors.js:625

e.executeLocal @ ej2-data.min.js:10

(anonymous) @ ej2-data.min.js:10

setTimeout (async)

e.nextTick @ ej2-data.min.js:10

e.executeQuery @ ej2-data.min.js:10

e.executeQuery @ ej2-grids.min.js:10

e.insert @ ej2-grids.min.js:10

e.getData @ ej2-grids.min.js:10

e.refreshDataManager @ ej2-grids.min.js:10

(anonymous) @ ej2-grids.min.js:10

t.notify @ ej2-base.min.js:10

e.trigger @ ej2-react-base.min.js:10

e.refresh @ ej2-grids.min.js:10

t.extendedPropertyChange @ ej2-grids.min.js:10

t.onPropertyChanged @ ej2-grids.min.js:10

t.dataBind @ ej2-base.min.js:10

e.dataBind @ ej2-base.min.js:10

t.setProperties @ ej2-base.min.js:10

t.setProperties @ ej2-grids.min.js:10

e.refreshProperties @ ej2-react-base.min.js:10

e.componentDidUpdate @ ej2-react-base.min.js:10

commitLayoutEffectOnFiber @ react-dom.development.js:23348

commitLayoutMountEffects_complete @ react-dom.development.js:24698

commitLayoutEffects_begin @ react-dom.development.js:24684

commitLayoutEffects @ react-dom.development.js:24622

commitRootImpl @ react-dom.development.js:26833

commitRoot @ react-dom.development.js:26692

finishConcurrentRender @ react-dom.development.js:25991

performConcurrentWorkOnRoot @ react-dom.development.js:25819

workLoop @ react.development.js:2653

flushWork @ react.development.js:2626

performWorkUntilDeadline @ react.development.js:2920

adaptors.js:625 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')

    at UrlAdaptor.processQuery (adaptors.js:625:35)

    at e.executeLocal (ej2-data.min.js:10:74366)

    at ej2-data.min.js:10:75536

UrlAdaptor.processQuery @ adaptors.js:625

e.executeLocal @ ej2-data.min.js:10

(anonymous) @ ej2-data.min.js:10

setTimeout (async)

e.nextTick @ ej2-data.min.js:10

e.executeQuery @ ej2-data.min.js:10

e.executeQuery @ ej2-grids.min.js:10

e.insert @ ej2-grids.min.js:10

e.getData @ ej2-grids.min.js:10

e.refreshDataManager @ ej2-grids.min.js:10

(anonymous) @ ej2-grids.min.js:10

t.notify @ ej2-base.min.js:10

e.trigger @ ej2-react-base.min.js:10

e.refresh @ ej2-grids.min.js:10

t.notify @ ej2-base.min.js:10

e.notify @ ej2-base.min.js:10

e.onPropertyChanged @ ej2-grids.min.js:10

t.notify @ ej2-base.min.js:10

e.notify @ ej2-base.min.js:10

t.extendedPropertyChange @ ej2-grids.min.js:10

t.onPropertyChanged @ ej2-grids.min.js:10

t.dataBind @ ej2-base.min.js:10

e.dataBind @ ej2-base.min.js:10

t.setProperties @ ej2-base.min.js:10

t.setProperties @ ej2-grids.min.js:10

e.refreshProperties @ ej2-react-base.min.js:10

e.componentDidUpdate @ ej2-react-base.min.js:10

commitLayoutEffectOnFiber @ react-dom.development.js:23348

commitLayoutMountEffects_complete @ react-dom.development.js:24698

commitLayoutEffects_begin @ react-dom.development.js:24684

commitLayoutEffects @ react-dom.development.js:24622

commitRootImpl @ react-dom.development.js:26833

commitRoot @ react-dom.development.js:26692

finishConcurrentRender @ react-dom.development.js:25991

performConcurrentWorkOnRoot @ react-dom.development.js:25819

workLoop @ react.development.js:2653

flushWork @ react.development.js:2626

performWorkUntilDeadline @ react.development.js:2920

adaptors.js:625 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')

    at UrlAdaptor.processQuery (adaptors.js:625:35)

    at e.executeLocal (ej2-data.min.js:10:74366)

    at ej2-data.min.js:10:75536



JC Joseph Christ Nithin Issack Syncfusion Team April 10, 2023 07:28 PM UTC

Mehdi,


   Before proceeding with the solution, we would like you to share the below details.


  • Complete grid rendering code.
  • Video demo of your requirement
  • Simple sample to replicate the issue.
  • Syncfusion package version you are using.




Loader.
Live Chat Icon For mobile
Up arrow icon