[CLOSED] Weird ComboBox behaviour - does not "collapse" dropdown on blur the first time, but the second time is OK

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [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.

    <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]

Similar Threads

  1. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  2. Replies: 6
    Last Post: Jan 28, 2012, 1:14 AM
  3. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  4. Replies: 2
    Last Post: May 14, 2011, 6:29 PM
  5. Replies: 13
    Last Post: Mar 31, 2011, 1:38 PM

Tags for this Thread

Posting Permissions