[英]ExtJS5 TypeError: Ext.ux.ProgressBarPager is not a constructor
我正在嘗試在MVVM項目中創建帶有進度條的網格。 它曾經可以工作,但是當我用
sencha app refresh
我開始收到“ TypeError:Ext.ux.ProgressBarPager不是構造函數”錯誤。
這是我在其中使用網格的面板:
Ext.define("GeoPortal.view.south.South",{
"extend": "GeoPortal.geox.components.Panel",
"controller": "south",
"viewModel": {
"type": "south"
},
"region": 'south',
"collapsible": true,
"collapsed": true,
"title": "SouthPanel",
"xtype": "southPanel",
"items": [{
xtype: 'gxPagedGrid',
params: {
store: 'GeoPortal.store.Companies',
pageSize: 5,
columns: [{
text: 'Name',
sortable: true,
dataIndex: 'name',
flex: 1
}, {
text: 'Price',
sortable: true,
formatter: 'usMoney',
dataIndex: 'price',
width: 75
}, {
text: 'Change',
sortable: true,
dataIndex: 'change',
width: 80
}, {
text: '% Change',
sortable: true,
dataIndex: 'pctChange',
width: 100
}]
}
}]
});
這是我的pagedGrid類:
Ext.define('GeoPortal.geox.components.PagedGrid', {
extend: 'GeoPortal.geox.components.Grid',
xtype: 'gxPagedGrid',
using: [
'Ext.toolbar.Paging',
'Ext.ux.ProgressBarPager'
],
initComponent: function () {
var store = new Ext.create(this.params.store, {
pageSize: this.params.pageSize,
proxy: {
enablePaging: true
}
});
Ext.apply(this, {
using: store,
store: store,
columns: this.params.columns,
bbar: {
xtype: 'pagingtoolbar',
pageSize: this.params.pageSize,
store: store,
displayInfo: true
// FIX: this
//plugins: new Ext.ux.ProgressBarPager()
}
});
this.callParent();
},
afterRender: function () {
this.callParent(arguments);
this.getStore().load();
}
});
先感謝您。
因為你用可能發生的問題using
,而不是requires
在類的定義。 這就是為什么當您嘗試創建實例時不會加載Ext.ux.ProgressBarPager
的原因。
Ext.create('Ext.ux.ProgressBarPager')
正在工作(如Ext.create('Ext.ux.ProgressBarPager')
所述),因為它能夠按需加載類,這就是為什么在new
上使用Ext.create
更好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.