jQuery EasyUI form - format drop-down box (ComboBox)

This tutorial shows you how to create a simple drop-down box (Combobox), let it show picture items in the drop-down box. You can use the formatter function in the drop-down box (combobox) on to tell it how to format each entry.

Create an image drop-down 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 class = "item-img" src = "' + imageFile + '" /> <span class = "item-text">' + row.text + '</ span>';
		}
	});

Download jQuery EasyUI examples

jeasyui-form-form4.zip