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

Custom json in DataSource schema

2 Answers 597 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Igor Stanek
Top achievements
Rank 1
Igor Stanek asked on 30 Nov 2017, 02:41 PM

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 Answers, 1 is accepted

Sort by
0
Igor Stanek
Top achievements
Rank 1
answered on 30 Nov 2017, 03:10 PM
I found access through:
transport / read / complete / responseJSON.
Is this a correct approach?
Thanks.
0
Stefan
Telerik team
answered on 04 Dec 2017, 07:24 AM
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.
Tags
Data Source
Asked by
Igor Stanek
Top achievements
Rank 1
Answers by
Igor Stanek
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or