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

Datasource / Datagrid issue on POST success

1 Answer 44 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
cra
Top achievements
Rank 1
cra asked on 08 Jan 2016, 09:25 PM

Hello all,

 

I have a Grid that is bound to a DataSource. The schema for the data source is such that there is an embeded (related / expanded) objecting being returned by the API. Everything works fine for the read and update methods. However when the create method is called, the response from the POST method in the API only returns the resource that was created (not the expanded / related data). So when the grid attempts to rebind to the response object it fails because it does not exist in the POST response.

 

Should we simply force our API to provide the expanded object in the response? This seems like a violation to the RESTful paradigm perhaps? 

 

How are others handling this scenario?

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 13 Jan 2016, 03:48 PM
Hello Christopher,

We will need more information on what these additional objects are in order to provide an up-to-the-point opinion in this case.

In case the additional objects represent foreign keys or nested fields, then they should have default values defined in the model. See the following demos for similar scenarios.

http://demos.telerik.com/kendo-ui/grid/foreignkeycolumn

http://demos.telerik.com/kendo-ui/grid/editing-custom

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