为什么ExtJS不允许我编辑这些组合框?

时间:2012-01-19 19:21:25

标签: combobox extjs4

好的,我在grid panel中有ExtJS 4.0.2,其中有一列是组合框。组合框允许我选择填充的数据就好了。但我希望用户能够使用自己编辑的文本覆盖组合中的数据驱动值。但是,当我在组合中键入任何内容时,它会消隐。我只能选择组合中的内容。周期。

这是我的模型和商店:

Ext.define('modResolutions', {
    extend: 'Ext.data.Model',
    fields: [
    {
        name:    'resolution',
        type:    'string'
    }]
});

this.stoResolutions = Ext.create('Ext.data.Store', {
    data : [],
    listeners:  {
        add: function(store, record, index) {
        },
        datachanged: function(store) {
        },
        update: function(store, record, operation) {
        }
    },
    model: 'modResolutions',
    storeId: 'stoResolutions'
});

这是我的专栏:

{
    dataIndex:  'resolution',
    field: {
        allowBlank:       true,
        dataIndex:        'resolution',
        displayField:     'resolution',
        editable:         true,
        emptyText:        'Enter a resolution',
        listeners: {
            beforequery: function(obj) {

            },
            select: function(combo, records, opts) {
            }
        },
        listWidth:        500,
        maxLength:        255,                       
        maxLengthText:    'Limited to 255 characters',
        msgTarget:        'side',                    
        queryMode:        'local',
        readOnly:         false,
        store:            stoResolutions,
        title:            'Enter a resolution',
        valueField:       'resolution',
        xtype:            'combobox'
    },
    header:     'Resolution',
    renderer: function(value) {
        return value;
    },
    valueField: 'resolution',
    width:      200
}

我错过了什么?

感谢。

1 个答案:

答案 0 :(得分:-1)

在组合框属性中添加forceSelection:false