May 24, 2011, 2:28 PM
[CLOSED] Problem setting value iconcombobox in code
Hi,
The current way of setting the value of an iconcombo throws serveral errorsr in the ext.axd:
Martin
The current way of setting the value of an iconcombo throws serveral errorsr in the ext.axd:
<!-- CSS -->
<style type="text/css">
.icon-combo-item
{
background-repeat: no-repeat !important;
background-position: 3px 50% !important;
padding-left: 24px !important;
}
</style>
<!-- Store -->
<ext:store id="strGeslacht" runat="server">
<reader>
<ext:arrayreader>
<fields>
<ext:recordfield name="iconCls" />
<ext:recordfield name="name" />
</fields>
</ext:arrayreader>
</reader>
</ext:store>
<!-- combobox -->
<ext:combobox allowblank="false" fireselectonload="true" id="cmbGeslacht" runat="server"
storeid="strGeslacht" flex="1" editable="false" displayfield="name" valuefield="name"
mode="Local" triggeraction="All" emptytext="-- maak keuze --" note="Geslacht">
<template id="Template1" runat="server">
<html>
<tpl for=".">
<div class="x-combo-list-item icon-combo-item {iconCls}">
{name}
</div>
</tpl>
</html>
</template>
<listeners>
<select handler="this.setIconCls(record.get('iconCls'));" />
</listeners>
</ext:combobox>
CODEBEHIND:// Pageload:
/// <summary>
/// Combobox geslacht vullen
/// </summary>
public void populateGeslacht()
{
strGeslacht.DataSource = new object[]
{
new object[] { ResourceManager.GetIconClassName(Icon.Male), "Man"},
new object[] { ResourceManager.GetIconClassName(Icon.Female), "Vrouw"},
};
strGeslacht.DataBind();
ResourceManager1.RegisterIcon(Icon.Male);
ResourceManager1.RegisterIcon(Icon.Female);
}
// The problem lies here when using data from the database. I'm trying to set the selected value:
cmbGeslacht.SetValue("Man"); // --> several errors in ext.axd --> White empty window
It worked some svn versions before. Somebody pointed me to the problem.Martin
Last edited by Daniil; May 31, 2011 at 10:44 AM.
Reason: [CLOSED]