PDA

View Full Version : Collapsed panel won't open



marc123
21 Sep 2013, 5:30 AM
Hi,

I have a panel, it displays fine and clicking the collapse button makes the panel colaps but clicking it again does not open it. What did I do wrong???
Code:


var panel = Ext.create('Ext.panel.Panel',{
title : 'My first panel',
width : '300px',
height : '200px',
closable : true,
collapsible : true,
renderTo : Ext.getBody()
});

The collapse button reacts on mouseover when panel is collapsed.
Thanks,
Marc

existdissolve
21 Sep 2013, 2:58 PM
Hi,

I have a panel, it displays fine and clicking the collapse button makes the panel colaps but clicking it again does not open it. What did I do wrong???
Code:


var panel = Ext.create('Ext.panel.Panel',{
title : 'My first panel',
width : '300px',
height : '200px',
closable : true,
collapsible : true,
renderTo : Ext.getBody()
});

The collapse button reacts on mouseover when panel is collapsed.
Thanks,
Marc

Try changing the height and width to be numbers, rather than strings. E.g., width: 300, height: 200.

Here's a fiddle that shows the fix:

kk

And the code:


var panel1 = Ext.create('Ext.panel.Panel', {
title: 'My first panel (broken)',
width: '300px',
height: '200px',
closable: true,
collapsible: true,
renderTo: Ext.getBody(),
html: 'Here is some text',
border: true
});


var panel2 = Ext.create('Ext.panel.Panel', {
title: 'My second panel (working)',
width: 300,
height: 200,
closable: true,
collapsible: true,
renderTo: Ext.getBody(),
html: 'Here is some text',
border: true
});

marc123
21 Sep 2013, 3:02 PM
Thanks, that fixed it..!

existdissolve
21 Sep 2013, 3:31 PM
Thanks, that fixed it..!

Glad to hear it. Can you mark my response as the answer, please?