Nested template data binding

2 posts, 0 answers
  1. dee
    dee avatar
    4 posts
    Member since:
    Jul 2016

    Posted 13 Jul Link to this post

    Please let me know if I am doing something wrong, or if is 2-way data binding possible in the following example - I am trying to put a checkbox inside of the inner template:

    <!DOCTYPE html>
        <title>KendoUI Test Page</title>
        <script src=""></script>
        <div id="home" data-role="view" data-init="onInit">
            <ul id="list"></ul>
        <script id="item-template" type="text/x-kendo-template">
            <div>#: foo #</div>
            #= kendo.render(kendo.template($("\\#user-template").html()), [user]) #
        <script id="user-template" type="text/x-kendo-template">
            <div style="color: red;">
                <span>#= isDefault#</span>
                <span><input type="checkbox" data-bind="checked:isDefault" id="chkTest" /></span>
            var app = new;
            function onInit(e) {
                    dataSource: {
                        data: [
                            {foo: "record1", user: { name: "John", age: 23, isDefault: true}},
                            {foo: "record2", user: { name: "Jane", age: 23, isDefault: false } },
                            {foo: "record3", user: { name: "Jack", age: 13, isDefault:false } }
                    appendOnRefresh: true,
                    template: $("#item-template").html()

  2. Stefan
    Stefan avatar
    195 posts

    Posted 15 Jul Link to this post

    Hello Dee,

    The two-way binding can be achieved only with MVVM using a kendo.observable. MVVM binding cannot be acheived directly with a specific item from a Kendo UI DataSource.

    Please check our examples of Kendo UI Mobile ListView with editing and with MVVM binding:

    In addition, please check the information about the integration between Kendo UI Mobile and MVVM:

    Let me know if you need additional information on this matter.

    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top