Nested Templates not rendering upon view model changes

2 posts, 0 answers
  1. Stacey
    Stacey avatar
    56 posts
    Member since:
    Aug 2013

    Posted 21 Sep 2013 Link to this post

    I am attempting to use a nested template, as detailed here : http://www.kendoui.com/forums/kendo-ui-framework/mvvm/knockout-2-inline-foreach-template.aspx#ihuL5TyNlkKcz9Znzm1gvA

    With the following code.

    <article>
        <div id="steps" data-template="steps-template" data-bind="source: Steps"></div>
    </article>
     
    <script id="mutations-template" type="text/x-kendo-template">
         <li data-bind="text: Aspect.Name"></li>
    </script>
    <script id="steps-template" type="text/x-kendo-template">
        <div data-id="${Id}">
            <h2 data-bind="text: Name"></h2>
            <div><ol data-bind="source: Mutations" data-template="mutations-template"></ol></div>
            <input class="autocomplete" data-key="${Id}" id="autocomplete-${Id}" />
        </div>
    </script>
    Within my autocomplete, there is code to add the selected data to the current items "Mutations" observable array.

    This works okay, it adds the data (I can see it with javascript inspection), but the nested template does not update. Is there anything else I can do about this?
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1445 posts

    Posted 25 Sep 2013 Link to this post

    Hi Stacy,

    I am afraid that the attached code snippets do not reveal enough information on what is causing this. Could you please provide runnable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.
     
    Regards,
    Alexander Popov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top