【发布时间】:2015-11-16 15:37:50
【问题描述】:
我正在尝试将现有应用程序从 ExtJs 4.2.1 移植到 6.0.1 在调试器中我看到网格有 'ext-empty-store' 存储而不是 'store.accounting.Quota' 的问题 我可以通过执行直接在面板激活侦听器中加载商店 var store = Ext.data.StoreManager.lookup('QuotaKPI.store.accounting.Quota'); 存储.load(); 在萤火虫中,我看到请求和完美的 json 作为响应,但网格中没有出现任何内容
这里是代码sn-ps
app/store/accounting/Quota.js
Ext.define('QuotaKPI.store.accounting.Quota', {
extend: 'Ext.data.JsonStore',
model: 'QuotaKPI.model.accounting.QuotaModel',
alias: 'store.accounting.Quota',
storeId: 'QuotaKPI.store.accounting.Quota',
autoLoad: false,
proxy: {
...
}
});
app/view/accounting/QuotaGrid.js
Ext.define('QuotaKPI.view.accounting.QuotaGrid', {
extend: 'Ext.grid.Panel'
,xtype: 'QuotaGrid'
,store: Ext.data.StoreManager.lookup('QuotaKPI.store.accounting.Quota')
,columns: [
...
]
,dockedItems : [
,{xtype: 'pagingtoolbar',
dock:'bottom',
store: Ext.data.StoreManager.lookup('QuotaKPI.store.accounting.Quota'),
displayInfo: true,
displayMsg: 'Displaying Quota Details {0} - {1} of {2}',
emptyMsg: "No Quota to display"
}
]
,initComponent: function() {
this.callParent(arguments);
}
});
在控制器中声明的存储、模型和网格
Ext.define('QuotaKPI.controller.accounting.AccountingController', {
extend: 'Ext.app.Controller',
stores: ['accounting.Quota'],
models: ['accounting.QuotaModel'],
views: ['accounting.QuotaGrid']
...
并且控制器本身在 app.js 中列出
Ext.application({
name: 'QuotaKPI',
controllers: [
'accounting.AccountingController'
],
init: function(app){
},
autoCreateViewport: true
});
有什么帮助吗?
【问题讨论】:
标签: extjs4.2 extjs6 extjs6-classic