PDA

View Full Version : Why is layout done multiple times?



Jazor
31 Jul 2009, 11:58 AM
The afterlayout event typically fires 3 times for components in my application...

I see posts on how to avoid handling the afterlayout event multiple times, but I'd be more interested in preventing the layout from happening more than once in the first place.

Is layout really done 3 times per component?!

hendricd
1 Aug 2009, 4:11 AM
The afterlayout event typically fires 3 times for components in my application...

I see posts on how to avoid handling the afterlayout event multiple times, but I'd be more interested in preventing the layout from happening more than once in the first place.

Is layout really done 3 times per component?!

@Jazor -- Try setting this somewhere early in your script :


Ext.Container.prototype.bufferResize = false;

Jazor
1 Aug 2009, 6:43 AM
Try setting this somewhere early in your script :


Ext.Container.prototype.bufferResize = false;

Okay, thanks for that - it doesn't prevent the 3 afterlayout events firing, but does improve apparent layout performance - everything appears in one go and looks tidier.

For anyone who is interested, see page 6 of this thread for an explanation on layout in Ext 3.0, including info on overriding bufferResize:

https://www.yui-ext.com/forum/showthread.php?t=70165&page=6