Hey,
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 jsonapi.org 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: http://jsonapi.org/format/#document-compound-documents
in my code:
working code:
$EmailAddressField = new \Kendo\Data\DataSourceSchemaModelField('EmailAddress');
$EmailAddressField->type('string');
$EmailAddressField->from('attributes.EmailAddress');
$schema = new \Kendo\Data\DataSourceSchema();
$schema ->model($model)->data('data');
not working code:
$PositionField = new \Kendo\Data\DataSourceSchemaModelField('Position');
$PositionField->type('string');
$PositionField->from('included.attributes.Description');
$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?