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

Dynamically adding elements to editor

1 Answer 163 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Ralph
Top achievements
Rank 1
Ralph asked on 13 Feb 2015, 04:37 PM
Hello,

I am seeing an issue in the editor for the diagram when I attempt to dynamically add elements to a bound source. I have setup a kendo template that binds to each element of an array off of the dataItem's model. I then want to be able to add or remove elements from this array. However when I add an element to the array the rendering of this new element gets appended within the first element as shown in this example: http://dojo.telerik.com/osOmA/2

I have worked around this issue by wrapping the inner template in a div however this behavior seems strange and should probably be fixed: â€‹http://dojo.telerik.com/osOmA

Thanks

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 17 Feb 2015, 09:45 AM
Hello Ralph,

Wrapping the elements is needed in order for the source binding to work and this is described in the documentation:

A single root element should be used in the template when binding to an array. Having two first level DOM elements will result in an erratic behavior.

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