1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    0
    serious is on a distinguished road

      0  

    Default Combobox is not scrolled automatically to the selected item.

    Combobox is not scrolled automatically to the selected item.


    Hi,

    I want combobox to show currently selected item on top of the drop-down list.
    Say, I have 100 items in my combobox, item 70 is selected but it is not shown to the user just after down arrow is clicked and list is expanded, user needs to scroll the list down in order to find currenly selected item.

    Is it possible to bring the selected item on top of the list?

    Thanks.

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    0
    serious is on a distinguished road

      0  

    Default


    Does Sencha Team have an idea?

  3. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    7,185
    Vote Rating
    194
    scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold

      0  

    Default


    I recall this was an issue with older version of ExtJS4, but it should be resolved. What version you are using?

    Scott.

  4. #4
    Sencha - Support Team
    Join Date
    Jun 2011
    Location
    Boston
    Posts
    75
    Vote Rating
    0
    germanicus is on a distinguished road

      0  

    Default


    You could try something like the following:
    Code:
    Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        displayField: 'name',
        valueField: 'abbr',
        renderTo: Ext.getBody(),
        listeners: {
            select: function (combo, records, eOpts) {
                var node = combo.picker.getNode(records[0]);
                combo.picker.listEl.insertFirst(node);
            }
        }
    })
    But using local queryMode you should never have to scroll to the selection.

  5. #5
    Sencha User
    Join Date
    Sep 2012
    Location
    Detroit
    Posts
    1
    Vote Rating
    0
    # ! AJoebudden ! # is on a distinguished road

      0  

    Default


    I was experiencing the same.. Code helped me out, thanks!!