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

Given this json , what must my datasources schema look like?

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 06 Feb 2013, 03:00 PM
[{"CompanyId":20,"CompanyName":"Walmart","CompanyContacts":[{"CompanyId":20,"FirstName":"Bob","LastName":"Green","Email":"bob@test.com"
,"Phone":"1234567","IsActive":false}]}]

This isn't doing it for me

schema: {
                  model: {
                      id:"CompanyId",
                      fields: {
                          CompanyContactId: { type: "number", editable: false, nullable: false },
                          FirstName: { type: "string", validation: { required: true } },
                          LastName: { type: "string", validation: { required: true } },
                          Email: { type: "string", validation: { required: true } },
                          Phone: { type: "string", validation: { required: true } },
                          IsActive: { type: "boolean" },
                      }
                  }
              }

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 08 Feb 2013, 09:05 AM
Hi Greg,

Thank you for contacting us.

The presented data is hierarchical - currently the DataSource (respectively the Grid) supports only flat data. You can display nested field using a template, however you may experience troubles with some of the DataSource features such as grouping, sorting, etc.

If possible, please use flat data.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Greg
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or