This is a migrated thread and some comments may be shown as answers.

schema.data doesn't work in TreeListDataSource

5 Answers 228 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Taras
Top achievements
Rank 2
Taras asked on 13 Jun 2017, 09:41 AM

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

Sort by
0
Stefan
Telerik team
answered on 15 Jun 2017, 05:41 AM
Hello Taras,

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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Taras
Top achievements
Rank 2
answered on 15 Jun 2017, 08:50 AM

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.

0
Boyan Dimitrov
Telerik team
answered on 19 Jun 2017, 07:24 AM

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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Taras
Top achievements
Rank 2
answered on 19 Jun 2017, 08:36 PM

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

0
Accepted
Boyan Dimitrov
Telerik team
answered on 21 Jun 2017, 10:52 AM

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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TreeList
Asked by
Taras
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Taras
Top achievements
Rank 2
Boyan Dimitrov
Telerik team
Share this question
or