gpt4 book ai didi

javascript - Extjs 组合框不更新

转载 作者:行者123 更新时间:2023-11-30 13:04:59 24 4
gpt4 key购买 nike

我在 ExtJS 4.2 中有一个组合框,我最初是用一个有 0 个项目的商店创建的。后来我计算了一堆东西并更新组合框,在与组合框关联的商店上使用 loadRawData。不知何故,商店得到更新,我已经逐步检查代码以确保,但组合框没有看到任何更新。

这是创建 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/

最佳答案

你使用内存代理——需要添加

queryMode: 'local',

在组合配置中: http://jsfiddle.net/qqHYp/4/

关于javascript - Extjs 组合框不更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16019951/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com