我遇到了一个问题,我想从窗口中删除 FormPanel。
这是我在窗口中加载的表单:
myForm = new Ext.FormPanel({
frame: true,
width: '100%',
id: 'myform',
layout: 'form',
autoHeight: true,
autoDestroy: false,
region: 'center',
monitorValid: true,
items: [{
xtype: 'textfield',
id: 'mytextfield',
fieldLabel: 'My Label',
}]
});
MyWindow = new Ext.Window({
title: 'MyWindow',
layout: 'auto',
resizable: false,
width: 717,
autoheight:true,
id:'mywindow',
closeAction:'hide',
closable: true,
items:[Ext.getCmp("myform")]
});
现在我想删除这个表格并且必须显示另一个表格,我在其他地方这样做:
MyWindow.removeAll();
MyWindow.add(Ext.getCmp("myAnotherForm"));
但这给了我"Uncaught TypeError: Cannot read property 'events' of undefined"
在 ext-all-debug.js 中的错误。
有什么,我在这里失踪了吗?
谢谢。