Custom json in DataSource schema

3 posts, 0 answers
  1. Igor Stanek
    Igor Stanek avatar
    14 posts
    Member since:
    Jan 2008

    Posted 30 Nov 2017 Link to this post

    Hello.

    I have a defined Data Source (for grid) like:

      transport: {
                     read: {
                         url: ....

     

    And returned json is like:
    {
    data: [...],
    total: xyz,
    customdata: [... data not explicit for grid ...]
    }

    Using schema, I define data and total for grid. But is it possible to process custom data? Get to them? It's not the data I need explicitly to bind the grid. But I can not call another ajax call.

    Well thank you.

  2. Igor Stanek
    Igor Stanek avatar
    14 posts
    Member since:
    Jan 2008

    Posted 30 Nov 2017 in reply to Igor Stanek Link to this post

    I found access through:
    transport / read / complete / responseJSON.
    Is this a correct approach?
    Thanks.
  3. Stefan
    Admin
    Stefan avatar
    1710 posts

    Posted 04 Dec 2017 Link to this post

    Hello, Igor,

    Thank you for sharing the approach.

    In this scenario, we can also suggest using a function for the read, and in the success, the additional data should be available in the result variable:

    https://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-transport.read

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 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