Ext.container.Container

任何可能包含其它Ext.Component組件的基類。 容器對於所包含的組件的基本處理包括添加,插入和刪除項目。html

包含Ext.Component,又是其餘容器的基類數組

Ext.container.Container

Ext.create('Ext.container.Container', {
    renderTo: Ext.getBody(),
});
<div class="x-container  x-container-default x-border-box" id="container-1009">
  <
div id="container-1009-outerCt" data-ref="outerCt" class="x-autocontainer-outerCt" role="presentation" style="width: 100%; table-layout: fixed;">
    <
div id="container-1009-innerCt" data-ref="innerCt" style="" class="x-autocontainer-innerCt" role="presentation">
    </
div>
  </
div>
</
div>

 

items:單個組件,或者是以數組形式定義的子組件集合 將會自動添加到容器中去,是組建容器管理其餘組建的屬性佈局

Ext.create('Ext.container.Container', {
    renderTo: Ext.getBody(),
    items:[{
        xtype:'box',
        html:'a'
    },{
        html:'b'
    }]
});
<div class="x-container  x-container-default x-border-box" id="container-1009">
    <div id="container-1009-outerCt" data-ref="outerCt" class="x-autocontainer-outerCt" role="presentation" style="width: 100%; table-layout: fixed;">
        <div id="container-1009-innerCt" data-ref="innerCt" style="" class="x-autocontainer-innerCt" role="presentation">
            <div class="x-component  x-component-default" id="box-1010">a</div>
            <div class="x-panel  x-panel-default" id="panel-1011" style="height: 19px;">
                <div id="panel-1011-body" data-ref="body" class="x-panel-body x-panel-body-default x-panel-body-default" role="presentation" style="width: 1595px; left: 0px; top: 0px; height: 19px;">
                    <div id="panel-1011-outerCt" data-ref="outerCt" class="x-autocontainer-outerCt" role="presentation" style="width: 100%; table-layout: fixed;">
                        <div id="panel-1011-innerCt" data-ref="innerCt" style="" class="x-autocontainer-innerCt" role="presentation">b</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

能夠看到items是innerCt下的其餘組建的幾何,且默認類型爲panelspa

layout:佈局,code

相關文章
相關標籤/搜索