Mar 11, 2010, 9:40 AM
[CLOSED] Problem using icon comboBox
Hi,
I am attaching a screen example showing a problem that I have using the comboBox with icons.
I am attaching a screen example showing a problem that I have using the comboBox with icons.
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
createLanguagesDataSource();
}
}
}
protected void createLanguagesDataSource()
{
this.StoreLanguages.DataSource = new object[]
{
new object[] { ResourceManager.GetIconClassName(Icon.FlagUs), "English", "en-US"},
new object[] { ResourceManager.GetIconClassName(Icon.FlagUs), "Espanol", "es-ES"}
};
this.StoreLanguages.DataBind();
ResourceManager1.RegisterIcon(Icon.FlagUs);
ResourceManager1.RegisterIcon(Icon.FlagEs);
}
<ext:Store ID="StoreLanguages" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="iconCls" />
<ext:RecordField Name="name" />
<ext:RecordField Name="culture" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:ComboBox ID="ComboBoxLANGUAGEField"
runat="server"
StoreID="StoreLanguages"
Editable="false"
TypeAhead="true"
Mode="Local"
TriggerAction="All"
DisplayField="name"
ValueField="culture"
Cls="textControlBackImage"
>
<Template ID="Template1" runat="server">
<Html>
<tpl for=".">
<div class="x-combo-list-item icon-combo-item {iconCls}">
{name}
</tpl>
</Html>
</Template>
<Listeners>
<Select Handler="this.setIconCls(record.get('iconCls'));" />
</Listeners>
<DirectEvents>
<Select OnEvent="ComboBoxLANGUAGEFieldSelect" />
</DirectEvents>
</ext:ComboBox>