jQuery EasyUI Form - Formatting Dropdown Box
This tutorial shows you how to create a simple dropdown box (Combobox) that displays image items in the dropdown list. You can use the formatter function on the dropdown box (combobox) to specify how each item should be formatted.
Creating an Image Dropdown Box (Combobox)
<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 decoding="async" class="item-img" src="'+imageFile+'"/><span class="item-text">'+row.text+'</span>';
}
});