template String|Function

The template used to render the items. By default the widget displays only the text of the data item (configured via dataTextField).

Example - specify template as a string literal

<input id="dropdownlist" />
let encode = kendo.htmlEncode;
  dataSource: [
    { id: 1, name: "Apples" },
    { id: 2, name: "Oranges" }
  dataTextField: "name",
  dataValueField: "id",
  template: ({ id, name }) => `<span><img src="/img/${id}.png" alt="${name}" />${name}</span>`
In this article