Search code examples
javascriptcomboboxextjs4.2dropdownbox

Extjs 4.2.1 Scroll to selection in combo drop down list


In extjs 4.2.1, there is some problem with combobox. When drop down list appears, i need to scroll to selected value, not only highlight it. So if selected value is on bottom, scroll remains on top anyways. Here is my code:

Ext.define('FpoApp.store.exams.Courses', {
    extend: 'Ext.data.Store',
    model: 'FpoApp.model.Idname',
    proxy: {
        type: 'ajax',
        url: 'php/exams/getCourses.php',
        reader: {
            type: 'json',
            root: 'rows'
        }
    },
    autoLoad: true
});

Ext.create('Ext.form.field.ComboBox', {
    queryMode: 'local',
    editable: false,
    valueField: 'id',
    displayField: 'name',   
    store: 'exams.Courses' 
});

Also, it seems to work in extjs 3.4.0. Just found an example, where it works perfectly, just as i need. Here is example. Looks like basic comboboxes, nothing special. Have no idea what's wrong with 4.2.1. And yes, i'm using mvc.


Solution

  • This seems to be a bug in Ext JS 4.2.1 version. In Ext JS 4.2.0 version and also in the newest Ext JS 4.2.2 version the behavior is same as in Ext js 3.4.0