Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.layout.container.Box.html
1 <!DOCTYPE html><html><head><title>Ext.layout.container.Box | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
2 <style type="text/css">.head-band { display: none; }
3 .header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
4 .doc-tab .members .member a.more { background-color: #efefef; }
5 </style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
6 </head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
7 <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
8
9     req = {
10         liveURL: '.',
11         standAloneMode: true,
12         origDocClass: 'Ext.layout.container.Box',
13         docClass: 'Ext.layout.container.Box',
14         docReq: 'Ext.layout.container.Box',
15         version: '4.0',
16         baseURL: '.',
17         baseDocURL: '.',
18         baseProdURL: '.'
19     };
20
21     clsInfo = {};
22
23
24
25 </script>
26
27 <script type="text/javascript" src="../search.js"></script>
28 <!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
29 <script type="text/javascript" src="../class_tree.js"></script>
30 <script type="text/javascript" src="../class_doc.js"></script>
31 <script type="text/javascript">
32     req.source = 'Box.html#Ext-layout.container.Box';
33     clsInfo = {"methods":["getLayoutItems","getRenderTarget","getTarget","updateChildBoxes"],"cfgs":["animate","bindToOwnerCtComponent","bindToOwnerCtContainer","clearInnerCtOnLayout","defaultMargins","flex","itemCls","pack","padding"],"properties":[],"events":[],"subclasses":["Ext.layout.container.HBox","Ext.layout.container.VBox"]};
34     Ext.onReady(function() {
35         Ext.create('Docs.classPanel');
36     });
37 </script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/Box.html#Ext-layout.container.Box" target="_blank">Ext.layout.container.Box</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><pre class="subclasses"><h4>Hierarchy</h4><div class="subclass f"><a href="Ext.layout.Layout.html" rel="Ext.layout.Layout" class="cls docClass">Ext.layout.Layout</a><div class="subclass"><a href="Ext.layout.container.AbstractContainer.html" rel="Ext.layout.container.AbstractContainer" class="cls docClass">Ext.layout.container.AbstractContainer</a><div class="subclass"><a href="Ext.layout.container.Container.html" rel="Ext.layout.container.Container" class="cls docClass">Ext.layout.container.Container</a><div class="subclass"><strong>Ext.layout.container.Box</strong></div></div></div></div></pre><p>Base Class for HBoxLayout and VBoxLayout Classes. Generally it should not need to be used directly.</p>
38
39 <div class="members"><div class="m-cfgs"><div class="definedBy">Defined By</div><a name="configs"></a><h3 class="cfg p">Config Options</h3><h4 class="cfgGroup">CSS Class configs</h4><div id="config-itemCls" class="member f inherited"><a href="Ext.layout.container.Box.html#config-itemCls" rel="config-itemCls" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.AbstractContainer.html" class="definedIn docClass">Ext.layout.container.AbstractContainer</a><br/><a href="../source/AbstractContainer2.html#Ext-layout.container.AbstractContainer-cfg-itemCls" class="viewSource">view source</a></div><a name="itemCls"></a><a name="config-itemCls"></a><a href="Ext.layout.container.Box.html#" rel="config-itemCls" class="cls expand">itemCls</a><span> : String</span></div><div class="description"><div class="short">An optional extra CSS class that will be added to the container. This can be useful for adding
40 customized styles to t...</div><div class="long"><p>An optional extra CSS class that will be added to the container. This can be useful for adding
41 customized styles to the container or any of its children using standard CSS rules. See
42 <a href="Ext.Component.html" rel="Ext.Component" class="docClass">Ext.Component</a>.<a href="Ext.Component.html#ctCls" rel="Ext.Component#ctCls" class="docClass">ctCls</a> also.</p>
43
44
45 <p></p></p>
46 </div></div></div><h4 class="cfgGroup">Other Configs</h4><div id="config-animate" class="member f ni"><a href="Ext.layout.container.Box.html#config-animate" rel="config-animate" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.Box.html" class="definedIn docClass">Ext.layout.container.Box</a><br/><a href="../source/Box.html#Ext-layout.container.Box-cfg-animate" class="viewSource">view source</a></div><a name="animate"></a><a name="config-animate"></a><a href="Ext.layout.container.Box.html#" rel="config-animate" class="cls expand">animate</a><span> : Mixed</span></div><div class="description"><div class="short">If truthy, child Component are animated into position whenever the Container
47 is layed out. If this option is numeric,...</div><div class="long"><p>If truthy, child Component are <i>animated</i> into position whenever the Container
48 is layed out. If this option is numeric, it is used as the animation duration in milliseconds.</p>
49
50
51 <p>May be set as a property at any time.</p>
52
53 </div></div></div><div id="config-bindToOwnerCtComponent" class="member inherited"><a href="Ext.layout.container.Box.html#config-bindToOwnerCtComponent" rel="config-bindToOwnerCtComponent" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.AbstractContainer.html" class="definedIn docClass">Ext.layout.container.AbstractContainer</a><br/><a href="../source/AbstractContainer2.html#Ext-layout.container.AbstractContainer-cfg-bindToOwnerCtComponent" class="viewSource">view source</a></div><a name="bindToOwnerCtComponent"></a><a name="config-bindToOwnerCtComponent"></a><a href="Ext.layout.container.Box.html#" rel="config-bindToOwnerCtComponent" class="cls expand">bindToOwnerCtComponent</a><span> : Boolean</span></div><div class="description"><div class="short"><p>Flag to notify the ownerCt Component on afterLayout of a change</p>
54 </div><div class="long"><p>Flag to notify the ownerCt Component on afterLayout of a change</p>
55 </div></div></div><div id="config-bindToOwnerCtContainer" class="member inherited"><a href="Ext.layout.container.Box.html#config-bindToOwnerCtContainer" rel="config-bindToOwnerCtContainer" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.AbstractContainer.html" class="definedIn docClass">Ext.layout.container.AbstractContainer</a><br/><a href="../source/AbstractContainer2.html#Ext-layout.container.AbstractContainer-cfg-bindToOwnerCtContainer" class="viewSource">view source</a></div><a name="bindToOwnerCtContainer"></a><a name="config-bindToOwnerCtContainer"></a><a href="Ext.layout.container.Box.html#" rel="config-bindToOwnerCtContainer" class="cls expand">bindToOwnerCtContainer</a><span> : Boolean</span></div><div class="description"><div class="short"><p>Flag to notify the ownerCt Container on afterLayout of a change</p>
56 </div><div class="long"><p>Flag to notify the ownerCt Container on afterLayout of a change</p>
57 </div></div></div><div id="config-clearInnerCtOnLayout" class="member ni"><a href="Ext.layout.container.Box.html#config-clearInnerCtOnLayout" rel="config-clearInnerCtOnLayout" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.Box.html" class="definedIn docClass">Ext.layout.container.Box</a><br/><a href="../source/Box.html#Ext-layout.container.Box-cfg-clearInnerCtOnLayout" class="viewSource">view source</a></div><a name="clearInnerCtOnLayout"></a><a name="config-clearInnerCtOnLayout"></a><a href="Ext.layout.container.Box.html#" rel="config-clearInnerCtOnLayout" class="cls expand">clearInnerCtOnLayout</a><span> : Boolean</span></div><div class="description"><div class="short"><p>&nbsp;</p></div><div class="long">
58 </div></div></div><div id="config-defaultMargins" class="member ni"><a href="Ext.layout.container.Box.html#config-defaultMargins" rel="config-defaultMargins" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.Box.html" class="definedIn docClass">Ext.layout.container.Box</a><br/><a href="../source/Box.html#Ext-layout.container.Box-cfg-defaultMargins" class="viewSource">view source</a></div><a name="defaultMargins"></a><a name="config-defaultMargins"></a><a href="Ext.layout.container.Box.html#" rel="config-defaultMargins" class="cls expand">defaultMargins</a><span> : Object</span></div><div class="description"><div class="short">If the individual contained items do not have a margins
59 property specified or margin specified via CSS, the default m...</div><div class="long"><p>If the individual contained items do not have a <tt>margins</tt>
60 property specified or margin specified via CSS, the default margins from this property will be
61 applied to each item.</p>
62
63
64 <br><p>This property may be specified as an object containing margins
65
66
67 <p>to apply in the format:</p></p>
68
69 <pre><code>{
70     top: (top margin),
71     right: (right margin),
72     bottom: (bottom margin),
73     left: (left margin)
74 }</code></pre>
75
76
77 <p>This property may also be specified as a string containing
78 space-separated, numeric margin values. The order of the sides associated
79 with each value matches the way CSS processes margin values:</p>
80
81
82 <div class="mdetail-params"><ul>
83 <li>If there is only one value, it applies to all sides.</li>
84 <li>If there are two values, the top and bottom borders are set to the
85 first value and the right and left are set to the second.</li>
86 <li>If there are three values, the top is set to the first value, the left
87 and right are set to the second, and the bottom is set to the third.</li>
88 <li>If there are four values, they apply to the top, right, bottom, and
89 left, respectively.</li>
90 </ul></div>
91
92
93 <p>Defaults to:</p>
94
95
96 <pre><code>{top:0, right:0, bottom:0, left:0}
97 </code></pre>
98
99 </div></div></div><div id="config-flex" class="member ni"><a href="Ext.layout.container.Box.html#config-flex" rel="config-flex" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.Box.html" class="definedIn docClass">Ext.layout.container.Box</a><br/><a href="../source/Box.html#Ext-layout.container.Box-cfg-flex" class="viewSource">view source</a></div><a name="flex"></a><a name="config-flex"></a><a href="Ext.layout.container.Box.html#" rel="config-flex" class="cls expand">flex</a><span> : Number</span></div><div class="description"><div class="short">This configuration option is to be applied to child items of the container managed
100 by this layout. Each child item wi...</div><div class="long"><p>This configuration option is to be applied to <b>child <tt>items</tt></b> of the container managed
101 by this layout. Each child item with a <tt>flex</tt> property will be flexed <b>horizontally</b>
102 according to each item's <b>relative</b> <tt>flex</tt> value compared to the sum of all items with
103 a <tt>flex</tt> value specified.  Any child items that have either a <tt>flex = 0</tt> or
104 <tt>flex = undefined</tt> will not be 'flexed' (the initial size will not be changed).</p>
105 </div></div></div><div id="config-itemCls" class="member inherited"><a href="Ext.layout.container.Box.html#config-itemCls" rel="config-itemCls" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.AbstractContainer.html" class="definedIn docClass">Ext.layout.container.AbstractContainer</a><br/><a href="../source/AbstractContainer2.html#Ext-layout.container.AbstractContainer-cfg-itemCls" class="viewSource">view source</a></div><a name="itemCls"></a><a name="config-itemCls"></a><a href="Ext.layout.container.Box.html#" rel="config-itemCls" class="cls expand">itemCls</a><span> : String</span></div><div class="description"><div class="short">An optional extra CSS class that will be added to the container. This can be useful for adding
106 customized styles to t...</div><div class="long"><p>An optional extra CSS class that will be added to the container. This can be useful for adding
107 customized styles to the container or any of its children using standard CSS rules. See
108 <a href="Ext.Component.html" rel="Ext.Component" class="docClass">Ext.Component</a>.<a href="Ext.Component.html#ctCls" rel="Ext.Component#ctCls" class="docClass">ctCls</a> also.</p>
109
110
111 <p></p></p>
112 </div></div></div><div id="config-pack" class="member ni"><a href="Ext.layout.container.Box.html#config-pack" rel="config-pack" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.Box.html" class="definedIn docClass">Ext.layout.container.Box</a><br/><a href="../source/Box.html#Ext-layout.container.Box-cfg-pack" class="viewSource">view source</a></div><a name="pack"></a><a name="config-pack"></a><a href="Ext.layout.container.Box.html#" rel="config-pack" class="cls expand">pack</a><span> : String</span></div><div class="description"><div class="short">Controls how the child items of the container are packed together. Acceptable configuration values
113 for this property ...</div><div class="long"><p>Controls how the child items of the container are packed together. Acceptable configuration values
114 for this property are:</p>
115
116 <div class="mdetail-params"><ul>
117 <li><b><tt>start</tt></b> : <b>Default</b><div class="sub-desc">child items are packed together at
118 <b>left</b> side of container</div></li>
119 <li><b><tt>center</tt></b> : <div class="sub-desc">child items are packed together at
120 <b>mid-width</b> of container</div></li>
121 <li><b><tt>end</tt></b> : <div class="sub-desc">child items are packed together at <b>right</b>
122 side of container</div></li>
123 </ul></div>
124
125 </div></div></div><div id="config-padding" class="member ni"><a href="Ext.layout.container.Box.html#config-padding" rel="config-padding" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.Box.html" class="definedIn docClass">Ext.layout.container.Box</a><br/><a href="../source/Box.html#Ext-layout.container.Box-cfg-padding" class="viewSource">view source</a></div><a name="padding"></a><a name="config-padding"></a><a href="Ext.layout.container.Box.html#" rel="config-padding" class="cls expand">padding</a><span> : String</span></div><div class="description"><div class="short">Sets the padding to be applied to all child items managed by this layout.
126
127
128 This property must be specified as a stri...</div><div class="long"><p>Sets the padding to be applied to all child items managed by this layout.</p>
129
130
131 <p>This property must be specified as a string containing
132 space-separated, numeric padding values. The order of the sides associated
133 with each value matches the way CSS processes padding values:</p>
134
135
136 <div class="mdetail-params"><ul>
137 <li>If there is only one value, it applies to all sides.</li>
138 <li>If there are two values, the top and bottom borders are set to the
139 first value and the right and left are set to the second.</li>
140 <li>If there are three values, the top is set to the first value, the left
141 and right are set to the second, and the bottom is set to the third.</li>
142 <li>If there are four values, they apply to the top, right, bottom, and
143 left, respectively.</li>
144 </ul></div>
145
146
147 <p>Defaults to: <code>"0"</code></p>
148
149 </div></div></div></div><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-getLayoutItems" class="member f inherited"><a href="Ext.layout.container.Box.html#method-getLayoutItems" rel="method-getLayoutItems" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.AbstractContainer.html" class="definedIn docClass">Ext.layout.container.AbstractContainer</a><br/><a href="../source/AbstractContainer2.html#Ext-layout.container.AbstractContainer-method-getLayoutItems" class="viewSource">view source</a></div><a name="getLayoutItems"></a><a name="method-getLayoutItems"></a><a href="Ext.layout.container.Box.html#" rel="method-getLayoutItems" class="cls expand">getLayoutItems</a> : Array</div><div class="description"><div class="short">Returns an array of child components either for a render phase (Performed in the beforeLayout method of the layout's
150 ...</div><div class="long"><p>Returns an array of child components either for a render phase (Performed in the beforeLayout method of the layout's
151 base class), or the layout phase (onLayout).</p>
152
153 <h3 class="pa">Returns</h3><ul><li><span class="pre">Array</span>&nbsp; &nbsp;<p>of child components</p>
154 </li></ul></div></div></div><div id="method-getRenderTarget" class="member inherited"><a href="Ext.layout.container.Box.html#method-getRenderTarget" rel="method-getRenderTarget" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.AbstractContainer.html" class="definedIn docClass">Ext.layout.container.AbstractContainer</a><br/><a href="../source/AbstractContainer2.html#Ext-layout.container.AbstractContainer-method-getRenderTarget" class="viewSource">view source</a></div><a name="getRenderTarget"></a><a name="method-getRenderTarget"></a><a href="Ext.layout.container.Box.html#" rel="method-getRenderTarget" class="cls expand">getRenderTarget</a> : Ext.core.Element</div><div class="description"><div class="short">Returns the element into which rendering must take place. Defaults to the owner Container's Ext.AbstractComponent.tar...</div><div class="long"><p>Returns the element into which rendering must take place. Defaults to the owner Container's <a href="Ext.AbstractComponent.html#targetEl" rel="Ext.AbstractComponent#targetEl" class="docClass">Ext.AbstractComponent.targetEl</a>.</p>
155
156
157 <p>May be overridden in layout managers which implement an inner element.</p>
158 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.core.Element</span>&nbsp; &nbsp;
159 </li></ul></div></div></div><div id="method-getTarget" class="member inherited"><a href="Ext.layout.container.Box.html#method-getTarget" rel="method-getTarget" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.AbstractContainer.html" class="definedIn docClass">Ext.layout.container.AbstractContainer</a><br/><a href="../source/AbstractContainer2.html#Ext-layout.container.AbstractContainer-method-getTarget" class="viewSource">view source</a></div><a name="getTarget"></a><a name="method-getTarget"></a><a href="Ext.layout.container.Box.html#" rel="method-getTarget" class="cls expand">getTarget</a> : Ext.core.Element</div><div class="description"><div class="short"><p>Returns the owner component's resize element.</p>
160 </div><div class="long"><p>Returns the owner component's resize element.</p>
161 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.core.Element</span>&nbsp; &nbsp;
162 </li></ul></div></div></div><div id="method-updateChildBoxes" class="member ni"><a href="Ext.layout.container.Box.html#method-updateChildBoxes" rel="method-updateChildBoxes" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.layout.container.Box.html" class="definedIn docClass">Ext.layout.container.Box</a><br/><a href="../source/Box.html#Ext-layout.container.Box-method-updateChildBoxes" class="viewSource">view source</a></div><a name="updateChildBoxes"></a><a name="method-updateChildBoxes"></a><a href="Ext.layout.container.Box.html#" rel="method-updateChildBoxes" class="cls expand">updateChildBoxes</a>(
163 <span class="pre">Array boxes</span>)
164  : void</div><div class="description"><div class="short"><p>Resizes and repositions each child component</p>
165 </div><div class="long"><p>Resizes and repositions each child component</p>
166 <h3 class="pa">Parameters</h3><ul><li><span class="pre">boxes</span> : Array<div class="sub-desc"><p>The box measurements</p>
167 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
168 </li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>