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

[Bug Report] - Property named "data" on object array breaks DataSource

1 Answer 18 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 09 May 2014, 07:21 PM
I am trying to create a data source from an array of javascript objects that, among other properties, contain a property named "data". The existence of the "data" property causes my Kendo UI controls to break. An example is at http://jsfiddle.net/DsR4e/. If the "data" property is renamed, everything returns to the expected behavior.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 10 May 2014, 07:08 AM
Hello Daniel,

The behavior you have described is caused by the fact that default parameter name of generated templates is data. Therefore, having a field on the actual dataItem called data will yield an error. In order to correct this, you will need to change the default parameter name via the Grid's templateSettings:

$("#grid").kendoGrid({
    templateSettings: { paramName: "f" },
    /*..*/
});

Here you can find a modified version of the test page you have provided.

Regards,
Rosen
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
Daniel
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or