PDA

View Full Version : Panel expanded after window close



giraffezw
21 Oct 2010, 3:31 AM
Hello,

I have a problem with a collapsible panel.
I open a window and expand the panel in the west region.
After the window is closed and reopened, the panel is still expanded.

Thanks!




var win = new Ext.Window({

width: Ext.isIE ? (document.body.clientWidth - 50) : (window.innerWidth - 50),
height: Ext.isIE ? (document.body.clientHeight - 50) : (window.innerHeight - 50),
layout: 'border',
id:'navwin',
closeAction : 'close',
items:[
{
region: 'west',
title: 'Navigation',
width: 300,
autoScroll:true,
containerScroll:true,
id:'directionsPanelMain',
collapsible: true,
collapsed:true,
border:true,
layout:'fit',
bodyStyle: 'padding: 5px 5px 5px 5px;',
items:[
{
xtype:'form',
baseCls: 'x-plain',
items: [
{
id: 'navfrom',
anchor:'100% ',
emptyText: 'Start',
hideLabel:true,
xtype:'textfield'
},{
id: 'navto',
anchor: '100%',
disabled:true,
hideLabel:true,
xtype:'textfield'
},{
xtype:'button',
text:'Navigation starten',
anchor: '100%',
style: 'margin:10px 0px 0px 0px;',
scope:this,
handler:function(){
//do something here….
}
},
{
xtype: 'panel',
hideLabel:true,
id:'directionsPanel',
autoScroll:true,
containerScroll:true,
anchor: '100%',
border:false,
bodyStyle: 'margin:20px 0px 0px 0px;'
}
]
}
]
},
{
region:’center’
}
]
});

Animal
21 Oct 2010, 4:20 AM
You can't reopen. It's destroyed. As explained in the documentation of the option you have explicitly used:

http://dev.sencha.com/deploy/dev/docs/?class=class=Ext.Window&member=closeAction

giraffezw
21 Oct 2010, 4:49 AM
ok, my fault. I meant re-create instead of "reopen".

the code is surrounded by



var win
if (!win) {
//define window
}

win.show();
But you are right! Exactly, the window should by destroyed after close, but it is not (firebug)

Animal
21 Oct 2010, 5:07 AM
Yes it is. Which is why you have a problem. The Window is destroyed. Read that link.

giraffezw
21 Oct 2010, 6:02 AM
thanks but why is the panel in the west region still knowing its last state (expanded or collapsed), after the window is closed.
should it not be collapsed as i created the window first time?


Thanks

Animal
21 Oct 2010, 6:06 AM
It's all moot after a destroy. But it won't change state. If you collapsed it, then destroying it will not uncollapse it.

giraffezw
21 Oct 2010, 6:39 AM
You're right. Thats what I expected. But I dont know why this happens. That panel is expanded, but it should be collapsed as defined in the config.
Perhaps somebody can test the code and reproduce my problem.

Animal
21 Oct 2010, 7:28 AM
You have not shown us your code in context.