【发布时间】:2013-01-08 01:39:05
【问题描述】:
我有以下 JSON,从后端接收它:
{
"scripts": [
"actions/rss",
"actions/db/initDb",
"actions/utils/MyFile",
"actions/utils/Valid"
],
"success": true
}
JSON 存储:
this.store = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: "http://www.example.com",
method: 'POST'
}),
baseParams: {
appId: "hsvdvndcnwvwbasxcwyc"
},
root: 'scripts',
fields: ['value']
});
组合框:
this.aField = new Ext.form.ComboBox({
fieldLabel : 'action',
name : 'actionName',
anchor : "95%",
allowBlank : false,
emptyText : "Select action",
triggerAction : 'all',
lazyRender : true,
mode : 'remote',
store : this.store,
valueField : 'value',
displayField : 'value'
});
所以,我收到了来自后端的响应,没关系。但是我的组合框下拉列表是空的(它显示了 10 个空行,它们等于 JSON 中的项目数)。我知道问题出在 JSON Store 的字段属性中。但是我应该在里面放什么才能让它工作呢?
谢谢!
【问题讨论】:
-
我使用 ExtJS 3.4。如果重要的话。
标签: javascript ajax json extjs extjs3