Apr 22, 2011, 11:51 AM
[CLOSED] Weird ComboBox behaviour - does not "collapse" dropdown on blur the first time, but the second time is OK
On this forum I have posted a lot it seems, and some of that touches on the behaviour of the ComboBox.
So in this case I have two comboboxes with a store, and when focusing on the ComboBox it opens the dropdown. I then choose an item using ENTER and when I press ENTER i want to be taken to another control and for the combobox to collapse.
A few problems:
- The first ComboBox does send focus to the next control (the "ComboBox_Second", see code below) but it does not close/collapse its dropdown the first time I do it. If I then go back to the first ComboBox and do the same thing again, it collapses the dropdown as expected
- The second ComboBox collapses the dropdown when I press ENTER, but it does not ship me to the next control (the DateField). So the code to change Focus to the "DateField_date" does not work, but if I send it to another control it works.
So in this case I have two comboboxes with a store, and when focusing on the ComboBox it opens the dropdown. I then choose an item using ENTER and when I press ENTER i want to be taken to another control and for the combobox to collapse.
A few problems:
- The first ComboBox does send focus to the next control (the "ComboBox_Second", see code below) but it does not close/collapse its dropdown the first time I do it. If I then go back to the first ComboBox and do the same thing again, it collapses the dropdown as expected
- The second ComboBox collapses the dropdown when I press ENTER, but it does not ship me to the next control (the DateField). So the code to change Focus to the "DateField_date" does not work, but if I send it to another control it works.
<ext:ComboBox ID="ComboBox_First " runat="server" AutoWidth="true" EmptyText="First ComboBox"
DisplayField="Name" ForceSelection="false"
ValueField="Id"
StoreID="Store_Stuff">
<Listeners>
<Focus Handler="this.onTriggerClick();" Delay="1" />
<Select Handler="if (this.getValue() > 0) { #{ComboBox_Second}.focus(); this.collapse(); }" />
<AfterRender Handler="this.keyNav.tab = function(){this.collapse(); return true;};" />
</Listeners>
</ext:ComboBox>
<ext:ComboBox ID="ComboBox_Second" runat="server" AutoWidth="true" EmptyText="Second combobox" ForceSelection="false"
DisplayField="Name"
ValueField="Id"
StoreID="Store_Stuff">
<Listeners>
<Focus Handler="this.onTriggerClick();" Delay="1" />
<Select Handler="if (this.getValue() > 0) { #{DateField_date}.focus(); this.collapse(); }" />
<AfterRender Handler="this.keyNav.tab = function(){this.collapse(); return true;};" />
</Listeners>
</ext:ComboBox>
<ext:DateField ID="DateField_date" runat="server" AutoWidth="true" EmptyText="Date" Icon="Date" FieldLabel="Datum">
<Listeners>
<Blur Fn="checkDateField" />
</Listeners>
</ext:DateField>
I cant figure out why. can you? =)
Last edited by Daniil; Apr 22, 2011 at 5:09 PM.
Reason: [CLOSED]