View Full Version : Layout glitch: items start at bottom then 'hop' to the top

Mike Robinson
7 Dec 2009, 11:12 AM
:-? I'm not sure how I am doing this, but "oops, I did it again ..." /:) Maybe someone has seen this too.

It seems to happen with a pop-up window. When the window first appears, the items (on the first page, if card-layout) appear at the bottom of the panel, and then are immediately re-drawn in their proper position at the top.

So... what might I be doing wrong here? I presume that I ought to be calling some routine first, waiting for something to finish happening, but I've really got no idea where to look for the source of this anomaly.

Has anyone else out there "seen this?" It would be great if someone said, "oh yeah, that happened to me, too, and I ..."

Anyone raising their hands right about now? ~o)

7 Dec 2009, 11:26 AM
Try setting Ext.Container.prototype.bufferResize to false at the top of your code.

Mike Robinson
7 Dec 2009, 11:36 AM
Nice idea ... didn't help.

Also, the pages that are doing this are almost empty. So, there really aren't any issues of the sort that "bufferResize" appears to be intended to address.

What I know is: I see this on Ext.Windows and it occurs when they first pop up.

Thinking about it... when the objects are drawn at the bottom of the page, they have their "correct" orientation relative to one another. In other words, they have been "laid out" at that point.

:-? If there was a setSize() call in an 'afterLayout' event-handler, might that do it? (I've implemented your suggestion about auto-sizing of windows on popup ...)

Mike Robinson
7 Dec 2009, 11:51 AM
Walking through the code:

Window.show() leads to afterShow().
At the "doLayout()" call in that routine, the window appears with the elements at the extreme bottom of the panel area. (A vertical scroll-bar appears.)

I'm now suspecting that there must be a bug in the "Ext.ux.Wizard" code that I am using elsewhere, because, at the point where I've got it halted at a breakpoint now, the "onShow()" code has executed, the text is at the bottom of the page, and there is no header at the top of the wizard-area. It should be there now. So, obviously, the anomaly happens when the wizard puts the header in, which forces a relayout.

Yep... when I let it go now, the redraw occurs. This now looks like an application-error in code I didn't write.

7 Dec 2009, 12:13 PM
I think 3.1 will resolve a lot of these layout problems.