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

Nested Templates not rendering upon view model changes

1 Answer 72 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Stacey
Top achievements
Rank 1
Stacey asked on 21 Sep 2013, 10:36 PM
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?

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 25 Sep 2013, 08:36 AM
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!
Tags
MVVM
Asked by
Stacey
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or