altTemplate Function
Template to be used for rendering the alternate items in the ListView.
The outermost HTML element in the template must be enclosed in another container such as a
div
orspan
element.
Example of alternate item template
<script type="text/kendo-x-tmpl" id="template">
<div>
Item template for #:name#
</div>
</script>
<script type="text/kendo-x-tmpl" id="altTemplate">
<div>
Alternate item template for #:name#
</div>
</script>
<div id ="listView"></div>
<script>
$("#listView").kendoListView({
dataSource: {
data: [
{ name: "Jane Doe" },
{ name: "John Doe" }
]
},
template: kendo.template($("#template").html()),
altTemplate: kendo.template($("#altTemplate").html())
});
</script>