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

Grid with nested objects datasource?

2 Answers 218 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yann
Top achievements
Rank 1
Yann asked on 10 Jul 2012, 12:45 AM
Hi,


I am using the Beta version 2012.2.621.

It happens that the model option is not set when i am using nested objects ( My model contains nested objects).
If I use the Model helper method, it doesn't work because it creates  something like 
model:{fields:{Parent.Children:{type:"number"}...

and this is not a valid javascript syntax.

Do I have to flatten my datasource or is there a workaround ?

Thanks.

Yann 

2 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 10 Jul 2012, 01:06 PM
Hello Yann,

I am afraid that the Grid does not support setting default values or mark them as not editable via the Model method just as you remarked. Yes you will need to flatten your data if you want to edit it, although displaying of these fields should work fine.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Yann
Top achievements
Rank 1
answered on 11 Jul 2012, 01:30 AM
It is not exactly fine even for a simple display mode because as field type cannot be set for Date, every date is considered a string and therefore cannot be formatted or correctly sorted / filtered
Tags
Grid
Asked by
Yann
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Yann
Top achievements
Rank 1
Share this question
or