Nov 02, 2009, 7:23 AM
[CLOSED] ComboBox trigger click fails to clear value
I'm using a trigger on a combo to clear the value. When the trigger is clicked, the combo box is cleared and the trigger hidden. However, when the control looses focus the cleared value is displayed again. What am I not doing!?
Thanks,
Ben
Thanks,
Ben
<ext:ComboBox ID="BookingEmployee" runat="server" Width="130" EmptyText="Employee"
AllowBlank="true" BlankText="Employee">
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
<Listeners>
<Select Handler="this.triggers[0].show();" />
<BeforeQuery Handler="this.triggers[0][this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
<TriggerClick Fn="ClearCombo" />
</Listeners>
</ext:ComboBox>
<script type="text/javascript">
ClearCombo = function(el, trigger, index) {
this.clearValue();
this.triggers[0].hide();
};</script>
The combo box is populated in code behind via a loop which does,Control.Items.Add(new Ext.Net.ListItem(query[i].Name, query[i].Id));