KendoUI issue with nested template
The nested template product-template is not being rendered.
HTML
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2012.1.322/js/kendo.all.min.js"></script>
<div id='listview'>
</div>
<script id="category-template" type="text/x-kendo-template">
<span>
<span>${categoryName}</span>
<div data-bind="source: products" data-template="product-template"></div>
</span>
</script>
<script id="product-template" type="text/x-kendo-template">
<span data-bind="text: productName"></span>
</script>
<div id='list' data-bind="source: categories" data-template="category-template">
</div>
JavaScript
// Expect products to show up inside the listview like they do for the div tag
var viewModel = kendo.observable({
categories: [{
categoryName: "Food",
products: [
{
productName: "Bread"
},
{
productName: "Meat"
}
]
},{
categoryName: "Drinks",
products: [
{
productName: "Beer"
},
{
productName: "Whiskey"
}
]
} ]
});
$('#listview').kendoListView({
dataSource:{data:viewModel.categories},
template: kendo.template($('#category-template').html())
});
kendo.bind($('#list'), viewModel)