PDA

View Full Version : how to change an applyTo after creating an Ext.Window



squalo
26 Jan 2011, 12:51 AM
I have a simple Task, in showing an Ext.Window with one or more TabPanels, but attached to different HTML-IDs
That means each time a certain button releases the onclick event, the correspondent JS function should raise the proper Ext.Window.
But it do not work like I've implented it. How can I solve a late "renderTo" or "applyTo" ?


var win;
function showrelnotes(version)
{
var applied_wnd = 'rel-notes-' + version; // HTML ID
var applied_tab = 'rel-tabs-' + version; // HTML ID

if(!win) {
win = new Ext.Window({
//applyTo: applied_wnd, // activating this, it works only and ever for the same ID
layout:'fit',
x:20,
width:500,
height:300,
closeAction:'hide',
plain: true,

items: new Ext.TabPanel({
//applyTo: applied_tab, // activating this, it works only and ever for the same ID
autoTabs:true,
activeTab:0,
deferredRender:false,
border:false
}),

buttons: [{
text: 'OK',
handler: function(){
win.hide();
}
}]
});
}
win.renderTo(applied_wnd); // ?? this doesnt work!
win.items.renderTo(applied_tab); // ?? this doesnt work!
win.show();
};
Thanks for any hints in advance
BR

mitchellsimoens
26 Jan 2011, 7:52 AM
Really don't think you can. You would have to update the Window manually.