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

Grid with incell editing does not support schema 'from' option

3 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rowan
Top achievements
Rank 1
Rowan asked on 27 Apr 2016, 12:42 AM

Hello,

We have a grid that maps nested model properties. We have used the schema 'from' option exactly as outlined here: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/use-nested-model-properties

However this does not work properly if the grid is configured with incell editing. Instead of editing the variable at its original location (as specified by the 'from' option), the grid just creates new dummy variables on the target object with the same name as the schema field. Any edits are then stored into those dummy fields rather than to the original location.

Here is a dojo example that reproduces the issue: http://dojo.telerik.com/eLOpI

If you open the console there is a timer that logs the toJSON() content of the object in the grid. You can see the dummy variables that get created, and whenever you make edits to the object the dummy variables update, but the original nested ones don't.

regards,

Rowan

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 28 Apr 2016, 02:32 PM

Hello Rowan,

Indeed, this is exactly how it is designed to work. The from settings uses the initial data's field value to populate a new field with the specified name, than if this object is synced, the shape of the object send to the server will be same as the original one. Thus, when using the object locally it will have the fields defined in the schema.field.from as this is how the local object is defined (via the schema.model) to look.

Here you can find a test page which demonstrate that the object received and send from/to the server has same shape.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
rwyborn
Top achievements
Rank 1
answered on 28 Apr 2016, 11:56 PM

Hi Rosen,

The problem in our case is that we are binding to a local data source rather than a remote one. So in this case we expect the data as returned by a datasource.data() call to be in the correct format. But that does not appear to be the case when using 'from'.

Is there a way to make 'from' work with a local data source?

thanks,

Rowan

0
Alex Gyoshev
Telerik team
answered on 02 May 2016, 12:42 PM

Hello rwyborn,

I am afraid that this is not supported -- see this thread on how to edit local data.

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