kendo dropdownlist template example

kendo dropdownlist template example

Hello everyone, I am going to share the customize items template and its headerTemplate for appearance of data items in kendo ui dropdown list. i.e.

$(function () {
    $("#customers").kendoDropDownList({
        dataTextField: "Name",
        dataValueField: "ID",
        dataSource: {
            transport: {
                read: {
                    dataType: "json",
                    url: "/api/customers/GetCustomers"
                }
            }
        },
        headerTemplate: '<div class="dropdown-header k-widget k-header">' + '<span>Contacts</span>' + '</div>',
        template'<span class="k-state-default">"<h3>#: ID #</h3>  - <h3>#: Name #</h3></span>'
    });

    var customer = $("#customers").data("kendoDropDownList");
    if (customer != undefined) {
        //TODO: you custom logic..
    }
});



ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.