FitLayout

FitLayout will size its first child to be the same size as its parent container. Unlike FillLayout, FitLayout will only size 1 single child and is not meant to be used with more than 1 child.

Here is an example of using a FitLayout with a Viewport. With the code, the content panel will be sized to the same size as the browser window. The viewport detects when its size changes, and executes its layout. In this case, the FitLayout gets executed and it sizes the content panel to be the same size as the viewport, which is the same size as the window size.

As with most GXT layouts, layout data can be used to provide additional configuration data to the layout. You can use a FitData to control the margins of the child component.