The layout base class of extjs is Ext. layout. containerlayout. Other layout types inherit this class. The extjs container component contains the layout and layoutconfig configuration attributes, which are used to specify the layout and detailed configuration information of the container, if the layout of the container component is not specified, containerlayout is used as the layout by default. This layout simply places elements in the container. Some layoutconfig configurations are required, while others do not need layoutconfig configurations. View Code :
Copy code The Code is as follows: Ext. onready (function (){
New Ext. Panel ({
Renderto: "hello ",
Width: 400,
Height: 200,
Layout: "column ",
Items: [{columnwidth:. 5,
Title: "Panel 1 "},
{Columnwidth:. 5,
Title: "Panel 2"}]
});
});
The above Code creates a panel. panle is a container component. We use layout to specify that the Panel uses the column layout. The sub-element of this Panel is two panels, both of which contain a configuration parameter attribute columnwidth related to the column layout. Their values are 0.5, that is, the width of each panel occupies half. Execute the precedingProgramGenerate the result as shown in:
Some container components in ext have already specified the layout used. For example, tabpanel uses the card layout, formpanel uses the form layout, and gridpanel uses the column layout. When using these components, you cannot specify another layout for these container components.
Extjs2.0 has a total of 10 la S. The commonly used la。 s include border, column, fit, form, card, and tabel. Below we will give a brief introduction to these la S.