日期:2014-05-16  浏览次数:20448 次

Extjs之布局详解

Extjs布局就是以一定的排版显示显示元素,不同的布局有不同的效果,并可以互相嵌套使用。

layout : String/Object

*Important: In order for child items to be correctly sized and positioned, typically a layout manager must be specified through the layout configuration option.


The sizing and positioning of child items is the responsibility of the Container's layout manager which creates and manages the type of layout you have in mind. For example:

new Ext.Window({
    width:300, height: 300,
    layout: 'fit', // explicitly set layout manager: override the default (layout:'auto')
    items: [{
        title: 'Panel inside a Window'
    }]
}).show();

If the layout configuration is not explicitly specified for a general purpose container (e.g. Container or Panel) the default layout manager will be used which does nothing but render child components sequentially into the Container (no sizing or positioning will be performed in this situation). Some container classes implicitly specify a default layout (e.g. FormPanel specifies layout:'form'). Other specific purpose classes internally specify/manage their internal layout (e.g. GridPanel, TabPanel, TreePanel, Toolbar, Menu, etc.).


layout may be specified as either as an Object or as a S