【发布时间】:2013-12-07 02:39:03
【问题描述】:
我无法将任何 json 数据加载到我的组合框中。这是我的代码:
app/data/mydata.json
{
images: [
{name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
{name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
]
}
在我的 app.js 中
var store4 = new Ext.data.JsonStore({
// store configs
storeId: 'myStore',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'app/data/mydata.json',
reader: {
type: 'json',
root: 'images',
idProperty: 'name'
}
},
});...
我在 app.js 中的组合框
{ xtype: 'combobox', queryMode: 'local', padding: 5, store: store4, displayField: 'name', typeAhead: true, emptyText: 'JSON', id: 'test' },
有什么想法吗? 干杯!
【问题讨论】: