A Fit layout
can be very useful to fit an item into all the available space of its container (for example a Viewport or a Window, or another Panel). In this example, a Window
is given a Fit layout so that the Panel takes up the full space of the Window
:
<ext:Window runat="server" Layout="Fit" Width="200" Height="200"> <Items> <ext:Panel Title="Fitted panel" AutoScroll="true" Border="false"> <BottomBar> <ext:StatusBar> <Items> <ext:Button Text="Click Me!" /> </Items> </ext:StatusBar> </BottomBar> </ext:Panel> </Items> </ext:Window>
When rendered, it will look like this:
The bottom bar has been added just for demonstration purposes. If we did not use a Fit layout in the previous example, the Panel would have been only as high as its contents (unless explicit width and height dimensions were added to the Panel itself) and the bottom...