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

DataSourceSchema structure

1 Answer 61 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Ramy asked on 02 Nov 2015, 10:00 AM


I'm using php wrappers in order to build my Kendo remote binding Grid.
the restfull server is rendering the output as a JSON format using v1.0 standard.

ex: {
  "links": {  ...  },
  "data": [
      "type": "people",
      "id": "7",
      "attributes": {​...},
      "relationships": {...},
      "links": {...}
  "included": [{...}]

using this standard will force you to separate the "foreign keys( ex: positions of the people , compound objects)" and include it into the "included" attribute
you can read more about it in the following link:

in my code:

working code:

$EmailAddressField = new \Kendo\Data\DataSourceSchemaModelField('EmailAddress');
$schema = new \Kendo\Data\DataSourceSchema();
$schema ->model($model)->data('data');​

not working code:

$PositionField = new \Kendo\Data\DataSourceSchemaModelField('Position');
$schema = new \Kendo\Data\DataSourceSchema();
$schema ->model($model)->data(new \Kendo\JavaScriptFunction('function(result) { return result; }'));​

 i cant figure out how ​to link my schema->model->data to the whole object , not just the 'data', i need also to get the data that are inside the "included" attribute.

any help?

1 Answer, 1 is accepted

Sort by
Georgi Krustev
Telerik team
answered on 04 Nov 2015, 09:35 AM
Hello Ramy,

You will need to combine the data and included fields into one list of data items. Thus the DataSource schema will be able to map the fields correctly and allow their editing. You can combine the data either in the callback or in a custom function.

Georgi Krustev
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question