Hi, according to documentation, The data source used by the kendo.ui.TreeList widget. Inherits from kendo.data.DataSource
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.data
But when I try to define
schema: {
data:"result"
}
Widget can't load any data.
5 Answers, 1 is accepted
I made an example using the schema.data in the TreeList and it is working as expected on my end:
http://dojo.telerik.com/utIZu
Please check the response returned from the server to ensure that it is in the expected format.
Regards,
Stefan
Progress Telerik
The difference in provided example by You and my situation is in method data loaded.
We use remote data binding.
a small video to show the problem. https://www.screencast.com/t/JSVmfXL4V
The difference only in 'data' field in the object. And without it - works.
If define the field widget doesn't load data and no any errors in the console to understand the reason.
Hello,
Maybe I am missing something, but after the schema.data configuration was removed (commented) from your code the response was slightly changed (there is no data field in the response to hold the data). The easist way would be to share the entire DataSource configuration and the exact response returned from the server. Preferably please paste them as a plain text here in order to avoid any misunderstanding with watching a video (maybe the horizontal scroll is moved to the right a bit and this is why the second response seems not have data field in the response).
Regards,Boyan Dimitrov
Progress Telerik
Yes. You are correct about changing in response.
From the documentation: 'schema.data -The field from the server response which contains the data items.'
That is why no 'data' object in response when schema.data not defined in config. (it is working variant)
But when schema.data is defined and contains which contains the array - it won't work. There is the reason the thread :)
P.S. Attached file with Widget config and 2 variants of responses. It contains only the top record, as won't load in when schema.data is defined.
P.P.S file is here https://www.dropbox.com/s/zeaidvhu9qgojam/settings_data.txt?dl=0
Hello Taras,
The problem with the response is that it contains an "errors" field that is not null. When the error field is different (even an empty array) the Kendo UI DataSource assumes that there is a server-side error. Please refer to the http://dojo.telerik.com/aqIxi example.
Regards,Boyan Dimitrov
Progress Telerik