May 09, 2021 jQuery EasyUI
This section describes how to format the jQuery EasyUI drop-down box (Combobox).
The following example shows you how to create a simple pull-down box that shows picture items in the pull-down box. You can use the formatter function on the pull-down box to tell it how to format each entry.
<input id="cc" style="width:100px"
url="data/combobox_data.json"
valueField="id" textField="text">
</input>
$('#cc').combobox({
formatter:function(row){
var imageFile = 'images/' + row.icon;
return '<img class="item-img" src="'+imageFile+'"/><span class="item-text">'+row.text+'</span>';
}
});