PDA

View Full Version : [FIXED-446][3.1.1-BETA]Initially collapsed Panels dont lay out properly on 1st expand



Animal
16 Jan 2010, 1:14 AM
http://www.extjs.com/deploy/ext-3.1.1-beta/examples/form/check-radio.html

Expand the top Fieldset (which extends Panel)

The layout is not correct.

The collapsed Fieldset gets fully rendered on initial render, as we would expect now, but a layout pass is not performed as is correct for hidden/collapsed Containers.

But the first expand should lay it out.

If, after expanding, you do



Ext.getCmp("ext-comp-1016").doLayout()
On the Firebug command line it lays it out correctly.

mschwartz
18 Jan 2010, 1:43 PM
This may be related...

The accordion demo seems broken. The initially hidden panels do not size to fill the container/layout when activated.

A side note, the docs say:



fill (http://www.extjs.com/forum/../deploy/dev/docs/source/AccordionLayout.html#cfg-Ext.layout.AccordionLayout-fill) : BooleanTrue to adjust the active item's height to fill the available space in the container, false to use the item's curren...
True to adjust the active item's height to fill the available space in the container, false to use the item's current height, or auto height if not explicitly set (defaults to true).


And I see nothing in the source code referring to the fit configuration item.

Jamie Avins
18 Jan 2010, 1:57 PM
Fixed in svn 5908

Jamie Avins
18 Jan 2010, 5:47 PM
Accordion was fixed in 5912.

Animal
19 Jan 2010, 4:26 AM
Looking at the Panel class, it has reinstated the adding of an "expand" listener within the onResize logic to apply sizing on expand.

It also has a check in afterExpand to perform layout. It would be better to use afterExpand method to do this, so in the "collapsed" side of the if have



// Cache onResize arguments during collapsed state, to call on next expand.
this.deferResize = Array.prototype.slice.call(arguments, 0);

// Do not perform superclass onResize operation: this whole process is on hold until afterExpand.
return;


And then



afterExpand : function(anim){
this.collapsed = false;
this.afterEffect(anim);

// If a resize operation was on hold, due to a collapsed state, perform it now.
// A layout operation is implicit on resize, so cancel any pending layout.
if (this.deferResize) {
this.onResize.apply(this, this.deferResize);
delete this.deferResize;
delete this.deferLayout;
}

// deferLayout is only set during hide. Does this code ever get executed?
if (this.deferLayout) {
delete this.deferLayout;
this.doLayout();
}
this.fireEvent('expand', this);
},

Jamie Avins
19 Jan 2010, 9:50 AM
I tried this implementation, but at the moment there are too many places that can start a rendering/layout process outside of this process. This is currently not only during hide, the deferHeight flag for panel is also stopping proper sizing as well (seen as the issue in Accordion). This can be restructured better for 3.2.