Skip to main content

template

sets a template of displaying options in the popup list

template?: (item: any) => string;

Example

var combo = new dhx.Combobox("combo_container", {
template: function (item) {
return "<div style='display:inline-block'>"
+"<img style='width:20px;height:20px;margin-right:10px;' src="+item.src+"/></div>"
+ item.value + "</div>";
}
});

Related sample: Combobox. Template

The template function takes as a parameter an item of data collection and should return a string with a template for rendering options in the list.