1 <div xmlns:ext="http://www.extjs.com" class="body-wrap"><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.layout.ContainerLayout.html" ext:member="" ext:cls="Ext.layout.ContainerLayout">ContainerLayout</a> <img src="resources/elbow-end.gif">BorderLayout</pre></div><h1>Class <a href="source/BorderLayout.html#cls-Ext.layout.BorderLayout">Ext.layout.BorderLayout</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.layout</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">BorderLayout.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/BorderLayout.html#cls-Ext.layout.BorderLayout">BorderLayout</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.layout.ContainerLayout.html" ext:cls="Ext.layout.ContainerLayout" ext:member="">ContainerLayout</a></td></tr></table><div class="description"><p>This is a multi-pane, application-oriented UI layout style that supports multiple
2 nested panels, automatic <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-split" ext:member="split" ext:cls="Ext.layout.BorderLayout.Region">split</a> bars between
3 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-BorderLayout.Region" ext:member="BorderLayout.Region" ext:cls="Ext.layout.BorderLayout.Region">regions</a> and built-in
4 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-collapsible" ext:member="collapsible" ext:cls="Ext.layout.BorderLayout.Region">expanding and collapsing</a> of regions.</p>
5 <p>This class is intended to be extended or created via the <tt>layout:'border'</tt>
6 <a href="output/Ext.Container.html#Ext.Container-layout" ext:member="layout" ext:cls="Ext.Container">Ext.Container.layout</a> config, and should generally not need to be created directly
7 via the new keyword.</p>
8 <p>BorderLayout does not have any direct config options (other than inherited ones).
9 All configuration options available for customizing the BorderLayout are at the
10 <a href="output/Ext.layout.BorderLayout.Region.html" ext:cls="Ext.layout.BorderLayout.Region">Ext.layout.BorderLayout.Region</a> and <a href="output/Ext.layout.BorderLayout.SplitRegion.html" ext:cls="Ext.layout.BorderLayout.SplitRegion">Ext.layout.BorderLayout.SplitRegion</a>
13 <pre><code><b>var</b> myBorderPanel = <b>new</b> Ext.Panel({
14 <a href="output/Ext.Component.html#Ext.Component-renderTo" ext:member="renderTo" ext:cls="Ext.Component">renderTo</a>: document.body,
15 <a href="output/Ext.BoxComponent.html#Ext.BoxComponent-width" ext:member="width" ext:cls="Ext.BoxComponent">width</a>: 700,
16 <a href="output/Ext.BoxComponent.html#Ext.BoxComponent-height" ext:member="height" ext:cls="Ext.BoxComponent">height</a>: 500,
17 <a href="output/Ext.Panel.html#Ext.Panel-title" ext:member="title" ext:cls="Ext.Panel">title</a>: <em>'Border Layout'</em>,
18 <a href="output/Ext.Container.html#Ext.Container-layout" ext:member="layout" ext:cls="Ext.Container">layout</a>: <em>'border'</em>,
19 <a href="output/Ext.Container.html#Ext.Container-items" ext:member="items" ext:cls="Ext.Container">items</a>: [{
20 <a href="output/Ext.Panel.html#Ext.Panel-title" ext:member="title" ext:cls="Ext.Panel">title</a>: <em>'South Region is resizable'</em>,
21 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-BorderLayout.Region" ext:member="BorderLayout.Region" ext:cls="Ext.layout.BorderLayout.Region">region</a>: <em>'south'</em>, <i>// position <b>for</b> region</i>
22 <a href="output/Ext.BoxComponent.html#Ext.BoxComponent-height" ext:member="height" ext:cls="Ext.BoxComponent">height</a>: 100,
23 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-split" ext:member="split" ext:cls="Ext.layout.BorderLayout.Region">split</a>: true, <i>// enable resizing</i>
24 <a href="output/Ext.SplitBar.html#Ext.SplitBar-minSize" ext:member="minSize" ext:cls="Ext.SplitBar">minSize</a>: 75, <i>// defaults to <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-minHeight" ext:member="minHeight" ext:cls="Ext.layout.BorderLayout.Region">50</a></i>
25 <a href="output/Ext.SplitBar.html#Ext.SplitBar-maxSize" ext:member="maxSize" ext:cls="Ext.SplitBar">maxSize</a>: 150,
26 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-margins" ext:member="margins" ext:cls="Ext.layout.BorderLayout.Region">margins</a>: <em>'0 5 5 5'</em>
28 <i>// xtype: <em>'panel'</em> implied by <b>default</b></i>
29 <a href="output/Ext.Panel.html#Ext.Panel-title" ext:member="title" ext:cls="Ext.Panel">title</a>: <em>'West Region is collapsible'</em>,
30 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-BorderLayout.Region" ext:member="BorderLayout.Region" ext:cls="Ext.layout.BorderLayout.Region">region</a>:<em>'west'</em>,
31 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-margins" ext:member="margins" ext:cls="Ext.layout.BorderLayout.Region">margins</a>: <em>'5 0 0 5'</em>,
32 <a href="output/Ext.BoxComponent.html#Ext.BoxComponent-width" ext:member="width" ext:cls="Ext.BoxComponent">width</a>: 200,
33 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-collapsible" ext:member="collapsible" ext:cls="Ext.layout.BorderLayout.Region">collapsible</a>: true, <i>// make collapsible</i>
34 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-cmargins" ext:member="cmargins" ext:cls="Ext.layout.BorderLayout.Region">cmargins</a>: <em>'5 5 0 5'</em>, <i>// adjust top margin when collapsed</i>
35 <a href="output/Ext.Component.html#Ext.Component-id" ext:member="id" ext:cls="Ext.Component">id</a>: <em>'west-region-container'</em>,
36 <a href="output/Ext.Container.html#Ext.Container-layout" ext:member="layout" ext:cls="Ext.Container">layout</a>: <em>'fit'</em>,
37 <a href="output/Ext.Panel.html#Ext.Panel-unstyled" ext:member="unstyled" ext:cls="Ext.Panel">unstyled</a>: true
39 <a href="output/Ext.Panel.html#Ext.Panel-title" ext:member="title" ext:cls="Ext.Panel">title</a>: <em>'Center Region'</em>,
40 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-BorderLayout.Region" ext:member="BorderLayout.Region" ext:cls="Ext.layout.BorderLayout.Region">region</a>: <em>'center'</em>, <i>// center region is required, no width/height specified</i>
41 <a href="output/Ext.Component.html#Ext.Component-xtype" ext:member="xtype" ext:cls="Ext.Component">xtype</a>: <em>'container'</em>,
42 <a href="output/Ext.Container.html#Ext.Container-layout" ext:member="layout" ext:cls="Ext.Container">layout</a>: <em>'fit'</em>,
43 <a href="output/Ext.layout.BorderLayout.Region.html#Ext.layout.BorderLayout.Region-margins" ext:member="margins" ext:cls="Ext.layout.BorderLayout.Region">margins</a>: <em>'5 5 0 0'</em>
46 <p><b><u>Notes</u></b>:</p><div class="mdetail-params"><ul>
47 <li>Any container using the BorderLayout <b>must</b> have a child item with <tt>region:'center'</tt>.
48 The child item in the center region will always be resized to fill the remaining space not used by
49 the other regions in the layout.</li>
50 <li>Any child items with a region of <tt>west</tt> or <tt>east</tt> must have <tt>width</tt> defined
51 (an integer representing the number of pixels that the region should take up).</li>
52 <li>Any child items with a region of <tt>north</tt> or <tt>south</tt> must have <tt>height</tt> defined.</li>
53 <li>The regions of a BorderLayout are <b>fixed at render time</b> and thereafter, its child Components may not be removed or added</b>. To add/remove
54 Components within a BorderLayout, have them wrapped by an additional Container which is directly
55 managed by the BorderLayout. If the region is to be collapsible, the Container used directly
56 by the BorderLayout manager should be a Panel. In the following example a Container (an Ext.Panel)
57 is added to the west region:
58 <div style="margin-left:16px"><pre><code>wrc = <a href="output/Ext.html#Ext-getCmp" ext:member="getCmp" ext:cls="Ext">Ext.getCmp</a>(<em>'west-region-container'</em>);
59 wrc.<a href="output/Ext.Panel.html#Ext.Panel-removeAll" ext:member="removeAll" ext:cls="Ext.Panel">removeAll</a>();
60 wrc.<a href="output/Ext.Container.html#Ext.Container-add" ext:member="add" ext:cls="Ext.Container">add</a>({
61 title: <em>'Added Panel'</em>,
62 html: <em>'Some content'</em>
64 wrc.<a href="output/Ext.Container.html#Ext.Container-doLayout" ext:member="doLayout" ext:cls="Ext.Container">doLayout</a>();</code></pre></div>
66 <li> To reference a <a href="output/Ext.layout.BorderLayout.Region.html" ext:cls="Ext.layout.BorderLayout.Region">Region</a>:
67 <div style="margin-left:16px"><pre><code>wr = myBorderPanel.layout.west;</code></pre></div>
69 </ul></div></div><div class="hr"></div><a id="Ext.layout.BorderLayout-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.layout.ContainerLayout-extraCls"></a><b><a href="source/ContainerLayout.html#cfg-Ext.layout.ContainerLayout-extraCls">extraCls</a></b> : String<div class="mdesc"><div class="short">An optional extra CSS class that will be added to the container. This can be useful for adding
70 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
71 customized styles to the container or any of its children using standard CSS rules. See
72 <a href="output/Ext.Component.html" ext:cls="Ext.Component">Ext.Component</a>.<a href="output/Ext.Component.html#Ext.Component-ctCls" ext:member="ctCls" ext:cls="Ext.Component">ctCls</a> also.</p>
73 <p><b>Note</b>: <tt>extraCls</tt> defaults to <tt>''</tt> except for the following classes
74 which assign a value by default:
75 <div class="mdetail-params"><ul>
76 <li><a href="output/Ext.layout.AbsoluteLayout.html" ext:cls="Ext.layout.AbsoluteLayout">Absolute Layout</a> : <tt>'x-abs-layout-item'</tt></li>
77 <li><a href="output/Ext.layout.Box.html" ext:cls="Ext.layout.Box">Box Layout</a> : <tt>'x-box-item'</tt></li>
78 <li><a href="output/Ext.layout.ColumnLayout.html" ext:cls="Ext.layout.ColumnLayout">Column Layout</a> : <tt>'x-column'</tt></li>
80 To configure the above Classes with an extra CSS class append to the default. For example,
81 for ColumnLayout:<pre><code>extraCls: <em>'x-column custom-class'</em></code></pre>
82 </p></div></div></td><td class="msource"><a href="output/Ext.layout.ContainerLayout.html#extraCls" ext:member="#extraCls" ext:cls="Ext.layout.ContainerLayout">ContainerLayout</a></td></tr><tr class="config-row inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.layout.ContainerLayout-renderHidden"></a><b><a href="source/ContainerLayout.html#cfg-Ext.layout.ContainerLayout-renderHidden">renderHidden</a></b> : Boolean<div class="mdesc">True to hide each contained item on render (defaults to false).</div></td><td class="msource"><a href="output/Ext.layout.ContainerLayout.html#renderHidden" ext:member="#renderHidden" ext:cls="Ext.layout.ContainerLayout">ContainerLayout</a></td></tr></tbody></table><a id="Ext.layout.BorderLayout-props"></a><h2>Public Properties</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Property</th><th class="msource-header">Defined By</th></tr><tr class="property-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.layout.ContainerLayout-fieldTpl"></a><b><a href="source/ContainerLayout.html#prop-Ext.layout.ContainerLayout-fieldTpl">fieldTpl</a></b> : Ext.Template<div class="mdesc"><div class="short">The Ext.Template used by Field rendering layout classes (such as
83 Ext.layout.FormLayout) to create the DOM structure o...</div><div class="long">The <a href="output/Ext.Template.html" ext:cls="Ext.Template">Ext.Template</a> used by Field rendering layout classes (such as
84 <a href="output/Ext.layout.FormLayout.html" ext:cls="Ext.layout.FormLayout">Ext.layout.FormLayout</a>) to create the DOM structure of a fully wrapped,
85 labeled and styled form Field. A default Template is supplied, but this may be
86 overriden to create custom field structures. The template processes values returned from
87 <a href="output/Ext.layout.FormLayout.html#Ext.layout.FormLayout-getTemplateArgs" ext:member="getTemplateArgs" ext:cls="Ext.layout.FormLayout">Ext.layout.FormLayout.getTemplateArgs</a>.</div></div></td><td class="msource"><a href="output/Ext.layout.ContainerLayout.html#fieldTpl" ext:member="#fieldTpl" ext:cls="Ext.layout.ContainerLayout">ContainerLayout</a></td></tr></tbody></table><a id="Ext.layout.BorderLayout-methods"></a><h2>Public Methods</h2><div class="no-members">This class has no public methods.</div><a id="Ext.layout.BorderLayout-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>