View Full Version : Layout component before its rendered

1 Jul 2011, 8:41 AM
I have a card panel that has 4 cards. Each card is a panel with a status bar that contains a form panel.
The panels layout are 'fit' and the form panels inside have the autoscroll property set to true. This makes my form buttons always visible at the bottom of the panel regardless of where I scroll.

When I switch to a new card for the first time I watch as the form panel inside the panel starts out really small and then finally renders to the correct size. not a huge issue it is just a little unpleasing to the eye.

I have messed around with the deferredRender and doLayoutOnCardChange properties with no luck. I have also played around with the hideMode property on the panel and its form panel with no luck.

Is there a way when I call set activeItem that I can first ask the card that I am about to set to figure out its layout, so that when the panel is displayed it is the right size?

I have tried the following with no luck:

// Try and force the panel to layout itself out before I set it to the active item
panel.doLayout(false, true); //shallow = false, force = true