Results 1 to 3 of 3

Thread: ComboBox : Options are looping on up/down key press.

  1. #1

    Default ComboBox : Options are looping on up/down key press.

    Hello All,

    I have a ComboBox (sample code attached below) with three options to select from. Again, when I press the down arrow key on the drop down list the options are changing. What I want is when the last(3rd) option is selected and down arrow key is pressed the last(3rd) option should remain selected in spite of the first option(its looping back to the first option). Similarly when the first option is selected and up arrow key is pressed, I don't want EXT to select the last option but I want it to keep the first option selected. Please confirm if its is possible and how it can be done.

    Thanx a lot..

    Code:
    // The data store containing the list of states
    var states = Ext.create('Ext.data.Store', {
        fields: ['abbr', 'name'],
        data : [
            {"abbr":"AL", "name":"Alabama"},
            {"abbr":"AK", "name":"Alaska"},
            {"abbr":"AZ", "name":"Arizona"}
            //...
        ]
    });
    
    
    // Create the combo box, attached to the states data store
    Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        displayField: 'name',
        valueField: 'abbr',
        renderTo: Ext.getBody()
    });

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Perhaps you could listen to the keyup and keydown events and cancel the move when appropriate.

  3. #3

    Default

    Thanx Gary for the response. I am not so sure as to how I can cancel the move when those event are triggered. Can you please help me. I have captured the keyup/keydown event. But dont know how to proceed.

    Thanx again for all your help.

Similar Threads

  1. ComboBox getValue problem on Enter key press
    By aluxner in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 20 Sep 2013, 3:26 PM
  2. [CLOSED] selection on combobox on tab press (again)
    By paolocavelli in forum Ext 3.x: Bugs
    Replies: 13
    Last Post: 13 Apr 2010, 6:20 PM
  3. [FIXED-606][3.1.1] selection on combobox on tab press
    By paolocavelli in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 5 Mar 2010, 3:26 PM
  4. Combobox tab press
    By prasanthsd in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 19 Feb 2010, 3:37 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •