简体   繁体   English

Extjs组合框未更新

[英]Extjs Combo Box Not Updating

I've got a combo box in ExtJS 4.2 that I initially create with a store that has 0 items. 我在ExtJS 4.2中有一个组合框,我最初创建的商店有0个项目。 Later on I compute a bunch of things and update the combo box use loadRawData on the store associated with the combobox. 稍后我计算了一堆东西并更新组合框使用与组合框相关联的商店上的loadRawData。 Somehow, the store gets updated, I've stepped through the code to make sure, but the combobox doesn't see any updates. 不知何故,商店得到更新,我已经逐步完成了代码以确保,但组合框没有看到任何更新。

Here's the code that creates the extjs stuff and a link to the relevant jsfiddle: 这是创建extjs东西的代码和相关jsfiddle的链接:

Ext.define('ItemTemplateModel', {
    extend: 'Ext.data.Model',
    fields: [
        { name: 'id', type: 'int' },
        { name: 'imageUri', type: 'string' },
        { name: 'name', type: 'string' }
    ]
});

var itemTemplateStore = Ext.create('Ext.data.Store', {
    model: 'ItemTemplateModel',
    autoLoad: false,
    proxy: {
        type: 'memory',
        reader: {
            type: 'json',
            root: 'entries'
        }
    }
});

var comboBox = Ext.create('Ext.form.field.ComboBox', {
    store: itemTemplateStore,
    fieldLabel: 'Item Template',
    name: 'template',
    displayField: 'name',
    valueField: 'id',
    editable: false,
    typeAhead: false,
    triggerAction: 'all'
});

http://jsfiddle.net/qqHYp/ http://jsfiddle.net/qqHYp/

You use memory proxy - need to add 您使用内存代理 - 需要添加

queryMode: 'local',

in combo config: http://jsfiddle.net/qqHYp/4/ 在combo配置中: http//jsfiddle.net/qqHYp/4/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM