【发布时间】:2014-09-06 20:52:12
【问题描述】:
我的 ExtJS Grid 没有显示我的商店数据。使用 ExtJS 5
这是我的网格(在 hbox 中):
{
xtype: 'grid',
title: 'Company Manager',
id: 'companyGrid',
flex: 1,
plugins: 'rowediting',
columnLines: true,
store: Ext.data.StoreManager.lookup('companyStore'),
columns: {
items: [{
header: 'ID',
dataIndex: 'id',
},
{
header: 'Name',
dataIndex: 'name',
},
{
header: 'Token',
dataIndex: 'access_token'
},
]
}
}
这是我的商店(我使用 Sencha 的 Google 扩展程序,它充满了我的数据,所以这有效 + 结尾 });被编码块忽略):
var companyStore = Ext.create('Ext.data.Store', {
storeId: 'companyStore',
proxy: {
type: 'ajax',
url: 'resources/data/company.json',
reader: {
type: 'json',
rootProperty: 'data'
}
},
fields: [{
name: 'id',
type: 'int'
}, {
name: 'name',
type: 'string'
}, {
name: 'access_token',
type: 'string'
}],
autoLoad: true
});
有人知道我在这里出错了吗?
我已经尝试过:重新加载商店,检查商店是否真的被填满,刷新网格视图。
我尝试过没有任何效果,我决定向你们寻求建议:)
【问题讨论】:
-
订单呢?与创建商店时相比,网格定义发生在哪里?
标签: javascript extjs grid jsonstore