schema.data doesn't work in TreeListDataSource

6 posts, 1 answers
  1. Taras
    Taras avatar
    39 posts
    Member since:
    May 2015

    Posted 13 Jun Link to this post

    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.

  2. Stefan
    Admin
    Stefan avatar
    1137 posts

    Posted 15 Jun Link to this post

    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 visualization (charts) and form elements.
  3. Taras
    Taras avatar
    39 posts
    Member since:
    May 2015

    Posted 15 Jun Link to this post

    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.

  4. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1966 posts

    Posted 19 Jun Link to this post

    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.
  5. Taras
    Taras avatar
    39 posts
    Member since:
    May 2015

    Posted 19 Jun in reply to Boyan Dimitrov Link to this post

    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 response contains object which contains the array - it won't work. There is the reason of the thread :)

    P.S. Attached file with Widget config and 2 variants of responses. It contains only the top record, as child 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

  6. Answer
    Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1966 posts

    Posted 21 Jun Link to this post

    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.
Back to Top