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

How to model this object?

2 Answers 56 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Lisa
Top achievements
Rank 1
Lisa asked on 25 Jul 2014, 06:14 PM
Hello,

I am having trouble creating a datasource schema model definition for the following json object returned from a service call.  How do I make the specification for the phones array and nested address object?

Thank you.

{
"customerId":50,
"name":"Customer Name",
"website":"http://customersite.com",
"phones"
:["939-555-1212", "212-333-1200"],
"address": {
     
"address1":"123 Main Street",
     
"address2":"Suite 10",
     
"city":"Santa Monica",
     "zip":"99029",
     "state_id":1,
     "country_id":1
     }

}

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 29 Jul 2014, 10:27 AM
Hi Lisa,

The DataSource is designed to work with a flat data and does not support array or complex object fields. That said it is not possible to specify a field of array type.
Could you please explain what exactly you would like to achieve? Does the phones have to be just displayed or the user should be able to edit, sort and filter this column?

Looking forward to your reply.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Lisa
Top achievements
Rank 1
answered on 29 Jul 2014, 03:05 PM
Basically we want to bind a DataSource loading remote data to Kendo widgets, but the data source model isn't flat.  I suppose we have the option of re-coding the API to return flat data.  Currently I've abandoned using a schema model and am using requestEnd processing to parse the data into a local array myself.

Thanks for the reply.
Tags
Data Source
Asked by
Lisa
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Lisa
Top achievements
Rank 1
Share this question
or