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>
<
html
>
<
head
>
<
title
>KendoUI Test Page</
title
>
<
link
href
=
"http://cdn.kendostatic.com/2012.3.1315/styles/kendo.mobile.all.min.css"
rel
=
"stylesheet"
/>
<
script
src
=
"http://code.jquery.com/jquery-1.8.2.min.js"
></
script
>
<
script
src
=
"http://cdn.kendostatic.com/2012.3.1315/js/kendo.all.min.js"
></
script
>
</
head
>
<
body
>
<
div
id
=
"home"
data-role
=
"view"
data-init
=
"onInit"
>
<
ul
id
=
"list"
></
ul
>
</
div
>
<
script
id
=
"item-template"
type
=
"text/x-kendo-template"
>
<
div
>#: foo #</
div
>
#= kendo.render(kendo.template($("\\#user-template").html()), [user]) #
</
script
>
<
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
>
</
div
>
</
script
>
<
script
>
var app = new kendo.mobile.Application();
function onInit(e) {
$("#list").kendoMobileListView({
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()
});
}
</
script
>
</
body
>
</
html
>