0
我有兩個面板,我想從另一個面板調用一個面板。我想銷燬第一個面板並將第二個面板呈現在第一個面板所在的位置。這是正確的方法嗎?如何從當前面板調用另一個extjs面板?
function create(){
var testButton = new Ext.Button({
text: 'Switch panel',
handler: function(){
Ext.getCmp('backgroundForm').destroy();
upload();
}
});
var backgroundForm = new Ext.Panel({
id: 'backgroundForm',
renderTo: 'mainPackage',
autoHeight: true,
buttons: [testButton]
});
}
function upload(){
var testButton = new Ext.Button({
text: 'Switch panel',
handler: function(){
alert('Test');
}
});
var backgroundForm = new Ext.Panel({
id: 'newBackgroundForm',
renderTo: 'mainPackage',
autoHeight: true,
button[newTestButton]
});
}