Jun 22, 2009, 2:48 PM
[CLOSED] ComboBox Blur or Lose Focus
Hi Vlad/Geoffery
I have the following ComboBox
Cheers
Steve
I have the following ComboBox
<ext:ComboBox
ID="createSelector"
HideLabel="true"
EmptyText="Create a new..."
runat="server"
BlankText="Create a new..."
Editable="false" >
<Items>
<ext:ListItem Text="Company" Value="company" />
<ext:ListItem Text="Contact" Value="contact" />
</Items>
<Listeners>
<Select Fn="createForm" />
</Listeners>
</ext:ComboBox>
and the following JS Codefunction createForm(field, oldValue, newValue) {
var formType;
if (typeof (oldValue) == 'string') {
formType = oldValue;
} else {
formType = oldValue.data.text;
}
if (field != null) {
field.clearValue();
field.blur();
}
loadTab(appPath + "/" + formType + "/Forms/" + formType + ".aspx?action=create", Ext.id(), "New " + formType);
}
I'm trying to clear the ComboBox after a user enters a value, so that it shows the Blank/Empty text again. I can't get the ComboBox to lose focus. If I click anywhere else on the form after I click a ComboBox value, all is well. Otherwise it sits there blank, with the cursor.Cheers
Steve