PDA

View Full Version : Collapsible panel inside Hbox layout



harman
21 May 2013, 11:06 PM
Hi All,

I have a panel inside another panel with hbox layout.
I want to make this inner panel as collapsible. But i figured that if i provide width in flex there are some problems in width calculations after expanded and collapsed more than once.
It collapses to the width according to flex but when expanded it takes the least width possible.

Note: I am using ExtJS 4.0.7

Help me find the solution to this.

Farish
21 May 2013, 11:14 PM
component.on('expand', function() {
component.doLayout();
});

try the same thing here. this will cause layout to get recalculated and might fix your issue.

harman
21 May 2013, 11:23 PM
Thanks for the quick reply. But this will work if i calculate the layout of outer panel.
But since calculating layout should never be the first choice i want some straight forward solution.
Is this a BUG? Why can the layout stay as is?

Farish
21 May 2013, 11:29 PM
which browser are you using. do you see some errors in the browser while expanding? there have been bugs (in older versions like 4.0.7) where the animation for expand/collapse causes an error to occur...

harman
21 May 2013, 11:34 PM
I have tested it on both Chrome v26.0 and Firefox v17.0.5 but i do not see any error on developer tool or firebug.

Farish
21 May 2013, 11:34 PM
does doLayout() help?

harman
22 May 2013, 12:29 AM
Yes but if i call it upon parent panel.

harman
22 May 2013, 12:45 AM
Adding to my pain, if i make it collapsed:'true' it appears with the least width it can take.
Again i need to catch an event and do layout.
This is now getting me sick.

Farish
22 May 2013, 1:08 AM
try to create a simple test case and run it with both 4.0.7. and 4.2.0. and you will find out if this is a bug in 4.0.7 which I suspect. many bugs seem to have been fixed in the newer version.

suvo
30 Dec 2014, 12:40 AM
That was really helpful.