0
FormPanelをウィンドウから削除したいという問題があります。ここでExtJS: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で与えます。
ここには何かがありますか?
ありがとうございました。
この問題は、フォームの "destroy()"メソッドを使用して、ウィンドウ内に同じフォームを追加することで発生します。 – Arfeen