Dynamically adding elements to editor

2 posts, 0 answers
  1. Ralph
    Ralph avatar
    17 posts
    Member since:
    May 2011

    Posted 13 Feb 2015 Link to this post

    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
  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 17 Feb 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top