Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / source / AbstractContainer2.html
1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-layout.container.AbstractContainer'>/**
2 </span> * @class Ext.layout.container.AbstractContainer
3  * @extends Ext.layout.Layout
4  * Please refer to sub classes documentation
5  */
6
7 Ext.define('Ext.layout.container.AbstractContainer', {
8
9     /* Begin Definitions */
10
11     extend: 'Ext.layout.Layout',
12
13     /* End Definitions */
14
15     type: 'container',
16
17     fixedLayout: true,
18
19     // @private
20     managedHeight: true,
21     // @private
22     managedWidth: true,
23
24 <span id='Ext-layout.container.AbstractContainer-cfg-bindToOwnerCtComponent'>    /**
25 </span>     * @cfg {Boolean} bindToOwnerCtComponent
26      * Flag to notify the ownerCt Component on afterLayout of a change
27      */
28     bindToOwnerCtComponent: false,
29
30 <span id='Ext-layout.container.AbstractContainer-cfg-bindToOwnerCtContainer'>    /**
31 </span>     * @cfg {Boolean} bindToOwnerCtContainer
32      * Flag to notify the ownerCt Container on afterLayout of a change
33      */
34     bindToOwnerCtContainer: false,
35
36 <span id='Ext-layout.container.AbstractContainer-cfg-itemCls'>    /**
37 </span>     * @cfg {String} itemCls
38      * &lt;p&gt;An optional extra CSS class that will be added to the container. This can be useful for adding
39      * customized styles to the container or any of its children using standard CSS rules. See
40      * {@link Ext.Component}.{@link Ext.Component#ctCls ctCls} also.&lt;/p&gt;
41      * &lt;/p&gt;
42      */
43
44     isManaged: function(dimension) {
45         dimension = Ext.String.capitalize(dimension);
46         var me = this,
47             child = me,
48             managed = me['managed' + dimension],
49             ancestor = me.owner.ownerCt;
50
51         if (ancestor &amp;&amp; ancestor.layout) {
52             while (ancestor &amp;&amp; ancestor.layout) {
53                 if (managed === false || ancestor.layout['managed' + dimension] === false) {
54                     managed = false;
55                     break;
56                 }
57                 ancestor = ancestor.ownerCt;
58             }
59         }
60         return managed;
61     },
62
63     layout: function() {
64         var me = this,
65             owner = me.owner;
66         if (Ext.isNumber(owner.height) || owner.isViewport) {
67             me.managedHeight = false;
68         }
69         if (Ext.isNumber(owner.width) || owner.isViewport) {
70             me.managedWidth = false;
71         }
72         me.callParent(arguments);
73     },
74
75 <span id='Ext-layout.container.AbstractContainer-method-setItemSize'>    /**
76 </span>    * Set the size of an item within the Container.  We should always use setCalculatedSize.
77     * @private
78     */
79     setItemSize: function(item, width, height) {
80         if (Ext.isObject(width)) {
81             height = width.height;
82             width = width.width;
83         }
84         item.setCalculatedSize(width, height, this.owner);
85     },
86
87 <span id='Ext-layout.container.AbstractContainer-method-getLayoutItems'>    /**
88 </span>     * &lt;p&gt;Returns an array of child components either for a render phase (Performed in the beforeLayout method of the layout's
89      * base class), or the layout phase (onLayout).&lt;/p&gt;
90      * @return {Array} of child components
91      */
92     getLayoutItems: function() {
93         return this.owner &amp;&amp; this.owner.items &amp;&amp; this.owner.items.items || [];
94     },
95
96     afterLayout: function() {
97         this.owner.afterLayout(this);
98     },
99 <span id='Ext-layout.container.AbstractContainer-method-getTarget'>    /**
100 </span>     * Returns the owner component's resize element.
101      * @return {Ext.core.Element}
102      */
103      getTarget: function() {
104          return this.owner.getTargetEl();
105      },
106 <span id='Ext-layout.container.AbstractContainer-method-getRenderTarget'>    /**
107 </span>     * &lt;p&gt;Returns the element into which rendering must take place. Defaults to the owner Container's {@link Ext.AbstractComponent#targetEl}.&lt;/p&gt;
108      * May be overridden in layout managers which implement an inner element.
109      * @return {Ext.core.Element}
110      */
111      getRenderTarget: function() {
112          return this.owner.getTargetEl();
113      }
114 });
115 </pre></pre></body></html>