New to Kendo UI for jQuery? Start a free 30-day trial
Templates
Updated on Jun 9, 2025
The ListView enables you to use templates for rendering its items.
The referred template displays the result that is set by the service.
js
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "https://demos.telerik.com/service/v2/core/Products"
}
}
});
$("#listView").kendoListView({
dataSource: dataSource,
template: kendo.template($("#template").html())
});
The outermost HTML element in the template must be enclosed in another container such as a
divorspanelement.
The following example demonstrates the full implementation of the suggested approach.
<div id="listView" style="max-height:400px;overflow:auto;"></div>
<script type="text/x-kendo-tmpl" id="template">
<div class="product">
<img src="https://demos.telerik.com/kendo-ui/content/web/foods/#= ProductID #.jpg" alt="Kendo UI for jQuery ListView #: ProductName # " />
<h3>#:ProductName#</h3>
<p>#:kendo.toString(UnitPrice, "c")#</p>
</div>
</script>
<script>
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "https://demos.telerik.com/service/v2/core/Products"
}
}
});
$("#listView").kendoListView({
dataSource: dataSource,
pageable: true,
template: kendo.template($("#template").html())
});
</script>