PDA

View Full Version : Created class and autoDestroy failure?



lormitto
5 Mar 2010, 12:06 AM
Hi


I created class mainWIndow presented below. Is uses Window and extend (which does not match exacly) its functionality. The main problem i must face is connected to simpleForm. When code of simple form is included into [] it works ok because each time new form is created. However when I use simpleForm as variable (which is better idea because of structure of the code) this window is open for the first time and trying to open it again (by double click on row) fails. I checked that after removing simpleForm for testing it is again ok.

Could you please taka a look and advise what I may do to resolve it?


function mainWindow(id) {
this.id=id;
var xWindow = new Ext.Window({
title : id, closable : true, modal : true, id: 'mainWindow', autoDestroy: false,
width : 850, height : 650, minimizable : false, resizable : true,
draggable : true, shadowOffset : 8, layout: 'form',
items :[

new Ext.TabPanel({
region:'center',
resizeTabs:true,
minTabWidth: 120,
autoDestroy: false,
autoScroll:true,
enableTabScroll:true,
defaults: {autoScroll:true},
activeTab:0,
items:[

{
id:'someID1',
autoDestroy: false,
items: [simpleForm],
border:false,
closable:false,
text:'Loading...',
title:'<div align="center">someTitle here</div>'
},
{
id:'someID2',
layout: 'fit',
border:false,
closable:false,
text:'loading...',
title:'<div align="center">SomeTitle2</div>'
},
{
id:'someId3',
layout: 'fit',
border:false,
closable:false,
text:'loading...',
title:'<div align="center">someTitle3</div>'
}

]

})
],
closeAction : "close"
});

xWindow.show();

}

lormitto
5 Mar 2010, 12:19 AM
I partly resolved it.

closeAction : "close" changed to "hide" helped me.

Unfortunately what I see after simpleForm load is blank page inside a Tab without any elements there :(

and window can not be closed.