Please override the getPicker method instead of the initComponent one.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Store store = this.MultiCombo1.GetStore();
store.DataSource = new object[]
{
new object[] { ResourceManager.GetIconClassName(Icon.FlagFr), "France"},
new object[] { ResourceManager.GetIconClassName(Icon.FlagCa), "Canada"},
new object[] { ResourceManager.GetIconClassName(Icon.FlagDe), "Germany"},
new object[] { ResourceManager.GetIconClassName(Icon.FlagUs), "United States"},
new object[] { ResourceManager.GetIconClassName(Icon.FlagIt), "Italy"}
};
store.DataBind();
ResourceManager1.RegisterIcon(Icon.FlagFr);
ResourceManager1.RegisterIcon(Icon.FlagCa);
ResourceManager1.RegisterIcon(Icon.FlagDe);
ResourceManager1.RegisterIcon(Icon.FlagUs);
ResourceManager1.RegisterIcon(Icon.FlagIt);
}
</script>
<html>
<head runat="server">
<title>Ext.NET Example</title>
<script type="text/javascript">
var myGetPicker = function () {
if (!this.picker) {
this.listConfig = this.listConfig || {};
this.listConfig.getInnerTpl = function (displayField) {
return '<div class="x-combo-list-item {[this.getItemClass(values)]}">' +
'<div class="x-mcombo-text icon-combo-item {iconCls}">{' + displayField + '}</div></div>'; // added " icon-combo-item {iconCls}"
};
this.listConfig.selModel = {
mode: 'SIMPLE'
};
this.picker = this.createPicker();
this.mon(this.picker.getSelectionModel(), 'select', this.onListSelect, this);
this.mon(this.picker.getSelectionModel(), 'deselect', this.onListDeselect, this);
this.picker.tpl.getItemClass = Ext.Function.bind(function (values) {
var record;
if (this.selectionMode === "selection") {
return "";
}
Ext.each(this.store.getRange(), function (r) {
// do not replace == by ===
if (r.get(this.valueField) == values[this.valueField]) {
record = r;
return false;
}
}, this);
if (record && this.picker.getSelectionModel().isSelected(record)) {
return "x-mcombo-item-checked";
}
return "x-mcombo-item-unchecked";
}, this, [], true);
if (this.selectionMode !== "checkbox") {
this.picker.on("render", function () {
this.picker.overItemCls = "x-multi-selected";
}, this);
}
this.picker.on("viewready", this.onViewReady, this, {single:true});
}
return this.picker;
};
</script>
<style type="text/css">
.icon-combo-item {
background-repeat: no-repeat ! important;
background-position: 3px 50% ! important;
padding-left: 24px ! important;
}
</style>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:MultiCombo
ID="MultiCombo1"
runat="server"
Width="250"
DisplayField="name"
QueryMode="Local"
EmptyText="Select countries...">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="iconCls" />
<ext:ModelField Name="name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<CustomConfig>
<ext:ConfigItem Name="getPicker" Value="myGetPicker" Mode="Raw" />
</CustomConfig>
</ext:MultiCombo>
</body>
</html>