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

kendo.data.Model can't have keys with periods in them

2 Answers 55 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Danny Fritz
Top achievements
Rank 1
Danny Fritz asked on 08 Jul 2014, 08:37 PM
When a JavaScript Object with keys that contain periods are used to create a Model, Model.set throws an error when trying to set the offending keys. Model internally does something like a "d." + key + "=value;" which would evaluate to "d.abc.def=value;" if the key was 'abc.def'. What it needs to evaluate to is "d['" + key + "']=value;" which would evaluate to "d['abc.def']=value;"

http://trykendoui.telerik.com/aSOY

2 Answers, 1 is accepted

Sort by
0
Danny Fritz
Top achievements
Rank 1
answered on 08 Jul 2014, 08:41 PM
Noticed nested fields being set is a feature of ObservableObject.set http://docs.telerik.com/kendo-ui/api/framework/observableobject#methods-set

Not sure where that leaves me.
0
Accepted
Alex Gyoshev
Telerik team
answered on 10 Jul 2014, 09:10 AM
Hello Danny,

Keys with periods are not supported, specifically because of the nested fields feature. Consider using a different separator in order to achieve this.

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
Data Source
Asked by
Danny Fritz
Top achievements
Rank 1
Answers by
Danny Fritz
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or