items.template String|Function

The template which renders as content for the appbar item. Valid only for the contentItem type

Example - set the template using function

<script id="first" type="text/x-kendo-template">
<input />
</script>
<script id="second" type="text/x-kendo-template">
    <h3>B</h3>
</script>
<div id="appbar"></div>
<script>
$("#appbar").kendoAppBar({
    items: [
        {
            type: "contentItem",
            template: kendo.template($("#first").html())
        },
        {
            type: "spacer"
        },
        {
            type: "contentItem",
            template: kendo.template($("#second").html())
        },
    ]
});
</script>

Example - set the template using string

<div id="appbar"></div>
<script>
$("#appbar").kendoAppBar({
    items: [
        {
            type: "contentItem",
            template: "<span><input /><span>"
        },
        {
            type: "spacer"
        },
        {
            type: "contentItem",
            template: "<h1>This is just a text</h1>"
        },
    ]
});
</script>
In this article
Not finding the help you need? Improve this article