2014-07-16 114 views
0

我的ExtJS网格未显示我的商店数据。使用ExtJS的5ExtJS网格未显示商店数据

这是我的网格(这是一个横向盒中):

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'}, 
    ] 
}, 

这是我的商店(我用煎茶的谷歌扩展,它充满了我的数据,因此这部作品+结束} );被编码块忽略):

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, 

有谁知道我在这里出错了吗?我试过了: 重新加载商店,检查商店是否实际填满,刷新网格视图。 没有我想工作,我决定要问你们的意见:)

+0

订单怎么样?与创建商店时相比,网格定义发生在哪里? –

回答

1

@Evan Trimboli

你让我觉得,我以防万一骗得第二,发现如下解决方案。

而不是使用store : Ext.data.StoreManager.lookup('companyStore'), 我用bind : '{companyStore}',并将define store移到CompanyModel.js文件:)现在它工作正常!!!!谢谢:D