PDA

View Full Version : Problem with Ext.Window and TabPanel



Dark Assassin
6 Jul 2010, 12:58 AM
Hi guys,
another time i'm asking you to help me!!!!
I've a tabPanel define like this in a file called tabsLoad.js :

var tabs2 = new Ext.TabPanel({
renderTo: 'tabs',
width:1040,
height: 600,
//activeTab: 1,
enableTabScroll:true,
frame:true,
items:[
{
contentEl:'apparati',
title: 'Apparati',
listeners:{
activate : function(tabpanel){
if(activeApp!=true){
initializeApparati();
baseForm();
activeApp=true;
}
//reloadStores();
}
}

},
.......

The function baseForm() is defined in another file apparati.js:


function baseForm(){
searchForm = new Ext.FormPanel({
labelAlign: 'top',
//url: 'elencoSearch.php',
renderTo: 'apparati-grid',
bodyStyle:'padding:5px',
defaults: {autoScroll: true},
width: 640,
buttons: [{
text: 'Scheda Dipendente',
handler: function(){
var sm = grid.getSelectionModel();
var sel = sm.getSelected();
if (sm.hasSelection()){
var win4 = new Ext.Window({
title:'Attivitą Dipendente',
//id:'win4',
resizable: false,
width:650,
height:550,
closeAction:'close',
items: tabContr,
buttons: [{
text: 'Chiudi',
handler: function(){
win4.close();
}
}]
}).show();
//win4.show(this);
}
}
}]
});

}


First time it works successfully, but when i close the window and try to reopen it, Firebug gives me this error:

c.getPositionEl().dom is undefined

Where is the error?
Please give me some clues...thank you all!!!!!!

Animal
6 Jul 2010, 1:02 AM
http://www.sencha.com/deploy/dev/docs/?class=Ext.Window&member=closeAction

http://www.sencha.com/learn/Ext_FAQ_Window#After_closing_my_Window.2C_showing_it_again_doesn.27t_show_the_contents

Dark Assassin
6 Jul 2010, 1:08 AM
Thanks Animal.
I've found the problem and solved before reading your answer...but it creates me another doubt.
So if i need to create everytime the windows, i need to define my item everytime inside the windows?

Animal
6 Jul 2010, 1:36 AM
No you don't need to create a Window every time. Re-use it.

Dark Assassin
6 Jul 2010, 1:41 AM
You're right....i'm creating too many problems!!!!!!
Thank you so much!