我对 ExtJS 还很陌生,但能够让 GridPanel 与相关的分页工具栏一起工作。一切正常,直到我关闭弹出窗口并打开另一个窗口。在随后的窗口加载中,我收到“me.dom is undefined”错误。如果我删除分页工具栏,一切正常。我使用的是 4.0.7 版。
提前致谢。
店铺定义:
Ext.define('VIMS.store.TOs',{
extend:'Ext.data.Store',
model:'VIMS.model.TO',
requires: 'VIMS.model.TO',
sorter:{property:'StartDate', direction:'DESC'},
buffered: true,
pageSize: 10,
listeners:{
beforeload: function(store,options) {
if(options.params && options.params.id){
store.getProxy().extraParams.id = options.params.id;
}
},
},
});
网格面板定义:
Ext.define('VIMS.view.TaskOrderList' ,{
extend: 'Ext.grid.Panel',
alias : 'widget.taskorderlist',
title : 'Task Orders',
store: 'TOs',
requires:'Ext.toolbar.Paging',
height:'100%',
columnLines:true,
/* removed this code ---------------------------------------
dockedItems :[{
xtype: 'pagingtoolbar',
store: 'TOs', // same store GridPanel is using
pageSize:10,
dock: 'bottom',
displayInfo: false,}],
-------------------------------------------- */
initComponent: function() {
this.columns = [
{header: 'Description', dataIndex: 'Description', flex: 1},
. . .
{header: 'Id', dataIndex: 'TaskOrderId', hidden:true},
];
// added from here ---------------------------------
var PagingBar = new Ext.PagingToolbar({
pageSize: 10,
store: 'TOs',
displayInfo: true,
});
this.bbar = PagingBar;
// to here ---------------------------------------
this.callParent(arguments);
}
});
要从我的控制器打开窗口,我使用以下命令:
var view = Ext.widget('contractedit');
view.modal = true;
view.down('form').loadRecord(record);
关闭通过以下方式处理:
closeMe: function(button) {
var win = button.up('window');
win.close();
},