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
    9,197
    Vote Rating
    482
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      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 - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    Boston
    Posts
    82
    Vote Rating
    5
    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!!

  6. #6
    Sencha User
    Join Date
    Sep 2013
    Posts
    1
    Vote Rating
    0
    Anusha Saxena 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.


    hello i am using the easy ui combobox in which i am binding 100 items now when i select the value from drop down and save in database i can set the selected value of combobox item number 41 but need to scroll it.

    How can i scroll automatically for select value in easyui combobox.

    Please help me out.

    Thanks,