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.

有帮助吗?

解决方案

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

其他提示

I had a similar issue using Ext's 4.2.0 ComboBox. Turns out I was causing the issue by calling clearFilter() on my data store after loading data asynchronously. Removing this method call fixed my issue:

myComboBox.store.clearFilter()

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Store-method-clearFilter

So this isn't a direct answer to your question, but the moral of the story is to look at your Data.Store as closely as your ComboBox. This would have saved me a few hours of banging my head against the wall :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top