Hello, I try to use ig.RemoteDataSource and property responseDataKey (response in JSON) in IgniteUi 15.2. In many examples in the documentation, the property is used with the values "d" or "d.results". I can not use anything in replacement of "d". example: d.rows: OK d.test: OK data.rows: NOK Apparently this does not work when the root property is not "d". Thanks for your help
Hi GBAU,
Taking the following "Remote Data" sample as an example:https://www.igniteui.com/sparkline/bind-to-remote-data
Here, we are also setting the responseDataKey to 'd.results'. If you review the json sent to the client, you will see that the results are enclosed in the "d" object. This is due to the default configuration of the OData service we use to send the json data to the client, as we've learned in the help topic I referenced in my last update. Note, this syntax is set through the service and not the RemoteDataSource or ODataRemoteDataSource on the client. If you wish to alter the way the json is constructed, you will have to make the changes within your service which is outside of the IgniteUI components.
I have attached a screenshot which helps demonstrates what I was referencing in the sample. Please let me know if you have additional questions regarding this matter.
Hi,
Thanks for your reply but I'm frightened by your answer. I use a generic object RemoteDataSource, not a ODataRemoteDataSource if it exists. Why when using "results" or "otherKey" directly it works (though not in the OData specifications) while "otherKey1.otherKey2" does not? Thanks
It's my understanding that this is the default syntax for when an OData Service returns json. More details regarding this standard is available in the oData Documentation:http://www.odata.org/documentation/odata-version-2-0/json-format/ If you wish to change this, you will need to make the appropriate changes to your service.
I hope this helps. Please let me know if you have additional questions regarding this matter.