items.templateFunction
Sets a custom template function for the item. The implemented items surface supports function values only. The function must return the item markup. If the top-level template option is configured, it takes precedence over items and per-item templates are not used.
Example - use a per-item template function
<div id="drawer">
<div>Content area content.</div>
</div>
<script>
$("#drawer").kendoDrawer({
mode: "push",
items: [
{
text: "Profile",
icon: "user",
template: function(item) {
return "<li data-role='drawer-item'>" +
kendo.ui.icon({ icon: item.icon }) +
"<span class='k-item-text'>" + kendo.htmlEncode(item.text) + "</span>" +
"</li>";
}
},
{ text: "Preferences", icon: "gear" }
]
});
</script>