commit extjs-2.2.1
[extjs.git] / docs / output / Ext.layout.AnchorLayout.html
1         <div class="body-wrap">
2         <div class="top-tools">
3             <a class="inner-link" href="#Ext.layout.AnchorLayout-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4             <a class="inner-link" href="#Ext.layout.AnchorLayout-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5             <a class="inner-link" href="#Ext.layout.AnchorLayout-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6                             <a class="inner-link" href="#Ext.layout.AnchorLayout-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7                         <a class="bookmark" href="../docs/?class=Ext.layout.AnchorLayout"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8         </div>
9                 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.layout.ContainerLayout" ext:member="" href="output/Ext.layout.ContainerLayout.html">ContainerLayout</a>
11   <img src="resources/elbow-end.gif"/>AnchorLayout</pre></div>
12                 <h1>Class Ext.layout.AnchorLayout</h1>
13         <table cellspacing="0">
14             <tr><td class="label">Package:</td><td class="hd-info">Ext.layout</td></tr>
15             <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/AnchorLayout.js" target="_blank">AnchorLayout.js</a></td></tr>
16             <tr><td class="label">Class:</td><td class="hd-info">AnchorLayout</td></tr>
17                         <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.layout.AbsoluteLayout" href="output/Ext.layout.AbsoluteLayout.html">AbsoluteLayout</a>, <a ext:cls="Ext.layout.FormLayout" href="output/Ext.layout.FormLayout.html">FormLayout</a></td></tr>
18                                     <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.layout.ContainerLayout" ext:member="" href="output/Ext.layout.ContainerLayout.html">ContainerLayout</a></td></tr>
19                     </table>
20         <div class="description">
21             *
22 <p>This is a layout that enables anchoring of contained elements relative to the container's dimensions.  If
23 the container is resized, all anchored items are automatically rerendered according to their anchor rules.
24 This class is intended to be extended or created via the layout:'anchor' <a ext:cls="Ext.Container" ext:member="layout" href="output/Ext.Container.html#layout">Ext.Container.layout</a> config,
25 and should generally not need to be created directly via the new keyword.</p>
26 <p>AnchorLayout does not have any direct config options (other than inherited ones).  However, the container
27 using the AnchorLayout can supply an anchoring-specific config property of <b>anchorSize</b>.  By default,
28 AnchorLayout will calculate anchor measurements based on the size of the container itself.  However, if
29 anchorSize is specifed, the layout will use it as a virtual container for the purposes of calculating anchor
30 measurements based on it instead, allowing the container to be sized independently of the anchoring logic if necessary.</p>
31 <p>The items added to an AnchorLayout can also supply an anchoring-specific config property of <b>anchor</b> which
32 is a string containing two values: the horizontal anchor value and the vertical anchor value (for example, '100% 50%').
33 This value is what tells the layout how the item should be anchored to the container.  The following types of
34 anchor values are supported:
35 <ul>
36 <li><b>Percentage</b>: Any value between 1 and 100, expressed as a percentage.  The first anchor is the percentage
37 width that the item should take up within the container, and the second is the percentage height.  Example: '100% 50%'
38 would render an item the complete width of the container and 1/2 its height.  If only one anchor value is supplied
39 it is assumed to be the width value and the height will default to auto.</li>
40 <li><b>Offsets</b>: Any positive or negative integer value.  The first anchor is the offset from the right edge of
41 the container, and the second is the offset from the bottom edge.  Example: '-50 -100' would render an item the
42 complete width of the container minus 50 pixels and the complete height minus 100 pixels.  If only one anchor value
43 is supplied it is assumed to be the right offset value and the bottom offset will default to 0.</li>
44 <li><b>Sides</b>: Valid values are 'right' (or 'r') and 'bottom' (or 'b').  Either the container must have a fixed
45 size or an anchorSize config value defined at render time in order for these to have any effect.</li>
46 </ul>
47 <p>Anchor values can also be mixed as needed.  For example, '-50 75%' would render the width offset from the
48 container right edge by 50 pixels and 75% of the container's height.</p>        </div>
49         
50         <div class="hr"></div>
51                 <a id="Ext.layout.AnchorLayout-configs"></a>
52         <h2>Config Options</h2>
53         <table cellspacing="0" class="member-table">
54             <tr>
55                 <th class="sig-header" colspan="2">Config Options</th>
56                 <th class="msource-header">Defined By</th>
57             </tr>
58                 <tr class="config-row inherited expandable">\r
59         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
60         <td class="sig">\r
61         <a id="Ext.layout.AnchorLayout-extraCls"></a>\r
62             <b>extraCls</b> : String            <div class="mdesc">\r
63                         <div class="short">An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding custo...</div>\r
64             <div class="long">\r
65                 An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding customized styles to the container or any of its children using standard CSS rules.            </div>\r
66                         </div>\r
67         </td>\r
68         <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#extraCls" href="output/Ext.layout.ContainerLayout.html#extraCls">ContainerLayout</a></td>\r
69     </tr>\r
70         <tr class="config-row inherited alt">\r
71         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
72         <td class="sig">\r
73         <a id="Ext.layout.AnchorLayout-renderHidden"></a>\r
74             <b>renderHidden</b> : Boolean            <div class="mdesc">\r
75                             True to hide each contained item on render (defaults to false).                        </div>\r
76         </td>\r
77         <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#renderHidden" href="output/Ext.layout.ContainerLayout.html#renderHidden">ContainerLayout</a></td>\r
78     </tr>\r
79             </table>
80                 <a id="Ext.layout.AnchorLayout-props"></a>
81         <h2>Public Properties</h2>
82         <div class="no-members">This class has no public properties.</div>        <a id="Ext.layout.AnchorLayout-methods"></a>
83         <h2>Public Methods</h2>
84         <div class="no-members">This class has no public methods.</div>        <a id="Ext.layout.AnchorLayout-events"></a>
85         <h2>Public Events</h2>
86         <div class="no-members">This class has no public events.</div>
87         </div>