4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-container-AbstractContainer'>/**
19 </span> * @class Ext.container.AbstractContainer
20 * @extends Ext.Component
21 * An abstract base class which provides shared methods for Containers across the Sencha product line.
24 Ext.define('Ext.container.AbstractContainer', {
26 /* Begin Definitions */
28 extend: 'Ext.Component',
31 'Ext.util.MixedCollection',
32 'Ext.layout.container.Auto',
37 <span id='Ext-container-AbstractContainer-cfg-layout'> /**
38 </span> * @cfg {String/Object} layout
39 * <p><b>Important</b>: In order for child items to be correctly sized and
40 * positioned, typically a layout manager <b>must</b> be specified through
41 * the <code>layout</code> configuration option.</p>
42 * <p>The sizing and positioning of child {@link #items} is the responsibility of
43 * the Container's layout manager which creates and manages the type of layout
44 * you have in mind. For example:</p>
45 * <p>If the {@link #layout} configuration is not explicitly specified for
46 * a general purpose container (e.g. Container or Panel) the
47 * {@link Ext.layout.container.Auto default layout manager} will be used
48 * which does nothing but render child components sequentially into the
49 * Container (no sizing or positioning will be performed in this situation).</p>
50 * <p><b><code>layout</code></b> may be specified as either as an Object or as a String:</p>
51 * <div><ul class="mdetail-params">
52 * <li><u>Specify as an Object</u></li>
53 * <div><ul class="mdetail-params">
54 * <li>Example usage:</li>
55 * <pre><code>
60 </code></pre>
62 * <li><code><b>type</b></code></li>
63 * <br/><p>The layout type to be used for this container. If not specified,
64 * a default {@link Ext.layout.container.Auto} will be created and used.</p>
65 * <p>Valid layout <code>type</code> values are:</p>
66 * <div class="sub-desc"><ul class="mdetail-params">
67 * <li><code><b>{@link Ext.layout.container.Auto Auto}</b></code> &nbsp;&nbsp;&nbsp; <b>Default</b></li>
68 * <li><code><b>{@link Ext.layout.container.Card card}</b></code></li>
69 * <li><code><b>{@link Ext.layout.container.Fit fit}</b></code></li>
70 * <li><code><b>{@link Ext.layout.container.HBox hbox}</b></code></li>
71 * <li><code><b>{@link Ext.layout.container.VBox vbox}</b></code></li>
72 * <li><code><b>{@link Ext.layout.container.Anchor anchor}</b></code></li>
73 * <li><code><b>{@link Ext.layout.container.Table table}</b></code></li>
74 * </ul></div>
76 * <li>Layout specific configuration properties</li>
77 * <p>Additional layout specific configuration properties may also be
78 * specified. For complete details regarding the valid config options for
79 * each layout type, see the layout class corresponding to the <code>type</code>
80 * specified.</p>
82 * </ul></div>
84 * <li><u>Specify as a String</u></li>
85 * <div><ul class="mdetail-params">
86 * <li>Example usage:</li>
87 * <pre><code>
89 </code></pre>
90 * <li><code><b>layout</b></code></li>
91 * <p>The layout <code>type</code> to be used for this container (see list
92 * of valid layout type values above).</p>
93 * <p>Additional layout specific configuration properties. For complete
94 * details regarding the valid config options for each layout type, see the
95 * layout class corresponding to the <code>layout</code> specified.</p>
96 * </ul></div></ul></div>
99 <span id='Ext-container-AbstractContainer-cfg-activeItem'> /**
100 </span> * @cfg {String/Number} activeItem
101 * A string component id or the numeric index of the component that should be initially activated within the
102 * container's layout on render. For example, activeItem: 'item-1' or activeItem: 0 (index 0 = the first
103 * item in the container's collection). activeItem only applies to layout styles that can display
104 * items one at a time (like {@link Ext.layout.container.Card} and {@link Ext.layout.container.Fit}).
106 <span id='Ext-container-AbstractContainer-cfg-items'> /**
107 </span> * @cfg {Object/Object[]} items
108 * <p>A single item, or an array of child Components to be added to this container</p>
109 * <p><b>Unless configured with a {@link #layout}, a Container simply renders child Components serially into
110 * its encapsulating element and performs no sizing or positioning upon them.</b><p>
111 * <p>Example:</p>
112 * <pre><code>
113 // specifying a single item
115 layout: 'fit', // The single items is sized to fit
117 // specifying multiple items
118 items: [{...}, {...}],
119 layout: 'hbox', // The items are arranged horizontally
120 </code></pre>
121 * <p>Each item may be:</p>
123 * <li>A {@link Ext.Component Component}</li>
124 * <li>A Component configuration object</li>
126 * <p>If a configuration object is specified, the actual type of Component to be
127 * instantiated my be indicated by using the {@link Ext.Component#xtype xtype} option.</p>
128 * <p>Every Component class has its own {@link Ext.Component#xtype xtype}.</p>
129 * <p>If an {@link Ext.Component#xtype xtype} is not explicitly
130 * specified, the {@link #defaultType} for the Container is used, which by default is usually <code>panel</code>.</p>
131 * <p><b>Notes</b>:</p>
132 * <p>Ext uses lazy rendering. Child Components will only be rendered
133 * should it become necessary. Items are automatically laid out when they are first
134 * shown (no sizing is done while hidden), or in response to a {@link #doLayout} call.</p>
135 * <p>Do not specify <code>{@link Ext.panel.Panel#contentEl contentEl}</code> or
136 * <code>{@link Ext.panel.Panel#html html}</code> with <code>items</code>.</p>
138 <span id='Ext-container-AbstractContainer-cfg-defaults'> /**
139 </span> * @cfg {Object/Function} defaults
140 * This option is a means of applying default settings to all added items whether added through the {@link #items}
141 * config or via the {@link #add} or {@link #insert} methods.
143 * Defaults are applied to both config objects and instantiated components conditionally so as not to override
144 * existing properties in the item (see {@link Ext#applyIf}).
146 * If the defaults option is specified as a function, then the function will be called using this Container as the
147 * scope (`this` reference) and passing the added item as the first parameter. Any resulting object
148 * from that call is then applied to the item as default properties.
150 * For example, to automatically apply padding to the body of each of a set of
151 * contained {@link Ext.panel.Panel} items, you could pass: `defaults: {bodyStyle:'padding:15px'}`.
155 * defaults: { // defaults are applied to items, not the container
159 * // default will not be applied here, panel1 will be autoScroll: false
165 * // this component will have autoScroll: true
166 * new Ext.panel.Panel({
172 <span id='Ext-container-AbstractContainer-cfg-suspendLayout'> /** @cfg {Boolean} suspendLayout
173 </span> * If true, suspend calls to doLayout. Useful when batching multiple adds to a container and not passing them
174 * as multiple arguments or an array.
176 suspendLayout : false,
178 <span id='Ext-container-AbstractContainer-cfg-autoDestroy'> /** @cfg {Boolean} autoDestroy
179 </span> * If true the container will automatically destroy any contained component that is removed from it, else
180 * destruction must be handled manually.
185 <span id='Ext-container-AbstractContainer-cfg-defaultType'> /** @cfg {String} defaultType
186 </span> * <p>The default {@link Ext.Component xtype} of child Components to create in this Container when
187 * a child item is specified as a raw configuration object, rather than as an instantiated Component.</p>
188 * <p>Defaults to <code>'panel'</code>.</p>
190 defaultType: 'panel',
194 <span id='Ext-container-AbstractContainer-property-layoutCounter'> /**
195 </span> * The number of container layout calls made on this object.
196 * @property layoutCounter
202 baseCls: Ext.baseCSSPrefix + 'container',
204 <span id='Ext-container-AbstractContainer-cfg-bubbleEvents'> /**
205 </span> * @cfg {String[]} bubbleEvents
206 * <p>An array of events that, when fired, should be bubbled to any parent container.
207 * See {@link Ext.util.Observable#enableBubble}.
208 * Defaults to <code>['add', 'remove']</code>.
210 bubbleEvents: ['add', 'remove'],
213 initComponent : function(){
216 <span id='Ext-container-AbstractContainer-event-afterlayout'> /**
217 </span> * @event afterlayout
218 * Fires when the components in this container are arranged by the associated layout manager.
219 * @param {Ext.container.Container} this
220 * @param {Ext.layout.container.Container} layout The ContainerLayout implementation for this container
223 <span id='Ext-container-AbstractContainer-event-beforeadd'> /**
224 </span> * @event beforeadd
225 * Fires before any {@link Ext.Component} is added or inserted into the container.
226 * A handler can return false to cancel the add.
227 * @param {Ext.container.Container} this
228 * @param {Ext.Component} component The component being added
229 * @param {Number} index The index at which the component will be added to the container's items collection
232 <span id='Ext-container-AbstractContainer-event-beforeremove'> /**
233 </span> * @event beforeremove
234 * Fires before any {@link Ext.Component} is removed from the container. A handler can return
235 * false to cancel the remove.
236 * @param {Ext.container.Container} this
237 * @param {Ext.Component} component The component being removed
240 <span id='Ext-container-AbstractContainer-event-add'> /**
243 * Fires after any {@link Ext.Component} is added or inserted into the container.
244 * @param {Ext.container.Container} this
245 * @param {Ext.Component} component The component that was added
246 * @param {Number} index The index at which the component was added to the container's items collection
249 <span id='Ext-container-AbstractContainer-event-remove'> /**
250 </span> * @event remove
252 * Fires after any {@link Ext.Component} is removed from the container.
253 * @param {Ext.container.Container} this
254 * @param {Ext.Component} component The component that was removed
259 // layoutOnShow stack
260 me.layoutOnShow = Ext.create('Ext.util.MixedCollection');
266 initItems : function() {
270 <span id='Ext-container-AbstractContainer-property-items'> /**
271 </span> * The MixedCollection containing all the child items of this container.
273 * @type Ext.util.MixedCollection
275 me.items = Ext.create('Ext.util.MixedCollection', false, me.getComponentId);
278 if (!Ext.isArray(items)) {
287 afterRender : function() {
292 renderChildren: function () {
294 layout = me.getLayout();
297 // this component's elements exist, so now create the child components' elements
300 me.suspendLayout = true;
301 layout.renderChildren();
302 delete me.suspendLayout;
307 setLayout : function(layout) {
308 var currentLayout = this.layout;
310 if (currentLayout && currentLayout.isLayout && currentLayout != layout) {
311 currentLayout.setOwner(null);
314 this.layout = layout;
315 layout.setOwner(this);
318 <span id='Ext-container-AbstractContainer-method-getLayout'> /**
319 </span> * Returns the {@link Ext.layout.container.AbstractContainer layout} instance currently associated with this Container.
320 * If a layout has not been instantiated yet, that is done first
321 * @return {Ext.layout.container.AbstractContainer} The layout
323 getLayout : function() {
325 if (!me.layout || !me.layout.isLayout) {
326 me.setLayout(Ext.layout.Layout.create(me.layout, 'autocontainer'));
332 <span id='Ext-container-AbstractContainer-method-doLayout'> /**
333 </span> * Manually force this container's layout to be recalculated. The framework uses this internally to refresh layouts
335 * @return {Ext.container.Container} this
337 doLayout : function() {
339 layout = me.getLayout();
341 if (me.rendered && layout && !me.suspendLayout) {
342 // If either dimension is being auto-set, then it requires a ComponentLayout to be run.
343 if (!me.isFixedWidth() || !me.isFixedHeight()) {
344 // Only run the ComponentLayout if it is not already in progress
345 if (me.componentLayout.layoutBusy !== true) {
346 me.doComponentLayout();
347 if (me.componentLayout.layoutCancelled === true) {
352 // Both dimensions set, either by configuration, or by an owning layout, run a ContainerLayout
354 // Only run the ContainerLayout if it is not already in progress
355 if (layout.layoutBusy !== true) {
365 afterLayout : function(layout) {
366 ++this.layoutCounter;
367 this.fireEvent('afterlayout', this, layout);
371 prepareItems : function(items, applyDefaults) {
372 if (!Ext.isArray(items)) {
376 // Make sure defaults are applied and item is initialized
381 for (; i < len; i++) {
384 item = this.applyDefaults(item);
386 items[i] = this.lookupComponent(item);
392 applyDefaults : function(config) {
393 var defaults = this.defaults;
396 if (Ext.isFunction(defaults)) {
397 defaults = defaults.call(this, config);
400 if (Ext.isString(config)) {
401 config = Ext.ComponentManager.get(config);
403 Ext.applyIf(config, defaults);
410 lookupComponent : function(comp) {
411 return Ext.isString(comp) ? Ext.ComponentManager.get(comp) : this.createComponent(comp);
415 createComponent : function(config, defaultType) {
416 // // add in ownerCt at creation time but then immediately
417 // // remove so that onBeforeAdd can handle it
418 // var component = Ext.create(Ext.apply({ownerCt: this}, config), defaultType || this.defaultType);
420 // delete component.initialConfig.ownerCt;
421 // delete component.ownerCt;
423 return Ext.ComponentManager.create(config, defaultType || this.defaultType);
426 // @private - used as the key lookup function for the items collection
427 getComponentId : function(comp) {
428 return comp.getItemId();
431 <span id='Ext-container-AbstractContainer-method-add'> /**
433 Adds {@link Ext.Component Component}(s) to this Container.
437 - Fires the {@link #beforeadd} event before adding.
438 - The Container's {@link #defaults default config values} will be applied
439 accordingly (see `{@link #defaults}` for details).
440 - Fires the `{@link #add}` event after the component has been added.
444 If the Container is __already rendered__ when `add`
445 is called, it will render the newly added Component into its content area.
447 __**If**__ the Container was configured with a size-managing {@link #layout} manager, the Container
448 will recalculate its internal layout at this time too.
450 Note that the default layout manager simply renders child Components sequentially into the content area and thereafter performs no sizing.
452 If adding multiple new child Components, pass them as an array to the `add` method, so that only one layout recalculation is performed.
454 tb = new {@link Ext.toolbar.Toolbar}({
455 renderTo: document.body
456 }); // toolbar is rendered
457 tb.add([{text:'Button 1'}, {text:'Button 2'}]); // add multiple items. ({@link #defaultType} for {@link Ext.toolbar.Toolbar Toolbar} is 'button')
461 Components directly managed by the BorderLayout layout manager
462 may not be removed or added. See the Notes for {@link Ext.layout.container.Border BorderLayout}
465 * @param {Ext.Component[]/Ext.Component...} component
466 * Either one or more Components to add or an Array of Components to add.
467 * See `{@link #items}` for additional information.
469 * @return {Ext.Component[]/Ext.Component} The Components that were added.
474 args = Array.prototype.slice.call(arguments),
484 if (typeof args[0] == 'number') {
485 index = args.shift();
488 hasMultipleArgs = args.length > 1;
489 if (hasMultipleArgs || Ext.isArray(args[0])) {
491 items = hasMultipleArgs ? args : args[0];
492 // Suspend Layouts while we add multiple items to the container
493 me.suspendLayout = true;
494 for (i = 0, ln = items.length; i < ln; i++) {
499 Ext.Error.raise("Trying to add a null item as a child of Container with itemId/id: " + me.getItemId());
504 item = me.add(index + i, item);
510 // Resume Layouts now that all items have been added and do a single layout for all the items just added
511 me.suspendLayout = false;
516 cmp = me.prepareItems(args[0], true)[0];
518 // Floating Components are not added into the items collection
519 // But they do get an upward ownerCt link so that they can traverse
520 // up to their z-index parent.
522 cmp.onAdded(me, index);
524 index = (index !== -1) ? index : me.items.length;
525 if (me.fireEvent('beforeadd', me, cmp, index) !== false && me.onBeforeAdd(cmp) !== false) {
526 me.items.insert(index, cmp);
527 cmp.onAdded(me, index);
528 me.onAdd(cmp, index);
529 me.fireEvent('add', me, cmp, index);
537 onRemove : Ext.emptyFn,
539 <span id='Ext-container-AbstractContainer-method-insert'> /**
540 </span> * Inserts a Component into this Container at a specified index. Fires the
541 * {@link #beforeadd} event before inserting, then fires the {@link #add} event after the
542 * Component has been inserted.
543 * @param {Number} index The index at which the Component will be inserted
544 * into the Container's items collection
545 * @param {Ext.Component} component The child Component to insert.<br><br>
546 * Ext uses lazy rendering, and will only render the inserted Component should
547 * it become necessary.<br><br>
548 * A Component config object may be passed in order to avoid the overhead of
549 * constructing a real Component object if lazy rendering might mean that the
550 * inserted Component will not be rendered immediately. To take advantage of
551 * this 'lazy instantiation', set the {@link Ext.Component#xtype} config
552 * property to the registered type of the Component wanted.<br><br>
553 * For a list of all available xtypes, see {@link Ext.Component}.
554 * @return {Ext.Component} component The Component (or config object) that was
555 * inserted with the Container's default config values applied.
557 insert : function(index, comp) {
558 return this.add(index, comp);
561 <span id='Ext-container-AbstractContainer-method-move'> /**
562 </span> * Moves a Component within the Container
563 * @param {Number} fromIdx The index the Component you wish to move is currently at.
564 * @param {Number} toIdx The new index for the Component.
565 * @return {Ext.Component} component The Component (or config object) that was moved.
567 move : function(fromIdx, toIdx) {
568 var items = this.items,
570 item = items.removeAt(fromIdx);
571 if (item === false) {
574 items.insert(toIdx, item);
580 onBeforeAdd : function(item) {
584 item.ownerCt.remove(item, false);
587 if (me.border === false || me.border === 0) {
588 item.border = (item.border === true);
592 <span id='Ext-container-AbstractContainer-method-remove'> /**
593 </span> * Removes a component from this container. Fires the {@link #beforeremove} event before removing, then fires
594 * the {@link #remove} event after the component has been removed.
595 * @param {Ext.Component/String} component The component reference or id to remove.
596 * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.
597 * Defaults to the value of this Container's {@link #autoDestroy} config.
598 * @return {Ext.Component} component The Component that was removed.
600 remove : function(comp, autoDestroy) {
602 c = me.getComponent(comp);
604 if (Ext.isDefined(Ext.global.console) && !c) {
605 console.warn("Attempted to remove a component that does not exist. Ext.container.Container: remove takes an argument of the component to remove. cmp.remove() is incorrect usage.");
609 if (c && me.fireEvent('beforeremove', me, c) !== false) {
610 me.doRemove(c, autoDestroy);
611 me.fireEvent('remove', me, c);
618 doRemove : function(component, autoDestroy) {
621 hasLayout = layout && me.rendered;
623 me.items.remove(component);
624 component.onRemoved();
627 layout.onRemove(component);
630 me.onRemove(component, autoDestroy);
632 if (autoDestroy === true || (autoDestroy !== false && me.autoDestroy)) {
636 if (hasLayout && !autoDestroy) {
637 layout.afterRemove(component);
640 if (!me.destroying) {
645 <span id='Ext-container-AbstractContainer-method-removeAll'> /**
646 </span> * Removes all components from this container.
647 * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.
648 * Defaults to the value of this Container's {@link #autoDestroy} config.
649 * @return {Ext.Component[]} Array of the destroyed components
651 removeAll : function(autoDestroy) {
653 removeItems = me.items.items.slice(),
656 len = removeItems.length,
659 // Suspend Layouts while we remove multiple items from the container
660 me.suspendLayout = true;
661 for (; i < len; i++) {
662 item = removeItems[i];
663 me.remove(item, autoDestroy);
665 if (item.ownerCt !== me) {
670 // Resume Layouts now that all items have been removed and do a single layout (if we removed anything!)
671 me.suspendLayout = false;
678 // Used by ComponentQuery to retrieve all of the items
679 // which can potentially be considered a child of this Container.
680 // This should be overriden by components which have child items
681 // that are not contained in items. For example dockedItems, menu, etc
682 // IMPORTANT note for maintainers:
683 // Items are returned in tree traversal order. Each item is appended to the result array
684 // followed by the results of that child's getRefItems call.
685 // Floating child items are appended after internal child items.
686 getRefItems : function(deep) {
688 items = me.items.items,
694 for (; i < len; i++) {
697 if (deep && item.getRefItems) {
698 result.push.apply(result, item.getRefItems(true));
702 // Append floating items to the list.
703 // These will only be present after they are rendered.
704 if (me.floatingItems && me.floatingItems.accessList) {
705 result.push.apply(result, me.floatingItems.accessList);
711 <span id='Ext-container-AbstractContainer-method-cascade'> /**
712 </span> * Cascades down the component/container heirarchy from this component (passed in the first call), calling the specified function with
713 * each component. The scope (<code>this</code> reference) of the
714 * function call will be the scope provided or the current component. The arguments to the function
715 * will be the args provided or the current component. If the function returns false at any point,
716 * the cascade is stopped on that branch.
717 * @param {Function} fn The function to call
718 * @param {Object} [scope] The scope of the function (defaults to current component)
719 * @param {Array} [args] The args to call the function with. The current component always passed as the last argument.
720 * @return {Ext.Container} this
722 cascade : function(fn, scope, origArgs){
724 cs = me.items ? me.items.items : [],
728 args = origArgs ? origArgs.concat(me) : [me],
729 componentIndex = args.length - 1;
731 if (fn.apply(scope || me, args) !== false) {
732 for(; i < len; i++){
735 c.cascade(fn, scope, origArgs);
737 args[componentIndex] = c;
738 fn.apply(scope || cs, args);
745 <span id='Ext-container-AbstractContainer-method-getComponent'> /**
746 </span> * Examines this container's <code>{@link #items}</code> <b>property</b>
747 * and gets a direct child component of this container.
748 * @param {String/Number} comp This parameter may be any of the following:
749 * <div><ul class="mdetail-params">
750 * <li>a <b><code>String</code></b> : representing the <code>{@link Ext.Component#itemId itemId}</code>
751 * or <code>{@link Ext.Component#id id}</code> of the child component </li>
752 * <li>a <b><code>Number</code></b> : representing the position of the child component
753 * within the <code>{@link #items}</code> <b>property</b></li>
754 * </ul></div>
755 * <p>For additional information see {@link Ext.util.MixedCollection#get}.
756 * @return Ext.Component The component (if found).
758 getComponent : function(comp) {
759 if (Ext.isObject(comp)) {
760 comp = comp.getItemId();
763 return this.items.get(comp);
766 <span id='Ext-container-AbstractContainer-method-query'> /**
767 </span> * Retrieves all descendant components which match the passed selector.
768 * Executes an Ext.ComponentQuery.query using this container as its root.
769 * @param {String} selector (optional) Selector complying to an Ext.ComponentQuery selector.
770 * If no selector is specified all items will be returned.
771 * @return {Ext.Component[]} Components which matched the selector
773 query : function(selector) {
774 selector = selector || '*';
775 return Ext.ComponentQuery.query(selector, this);
778 <span id='Ext-container-AbstractContainer-method-child'> /**
779 </span> * Retrieves the first direct child of this container which matches the passed selector.
780 * The passed in selector must comply with an Ext.ComponentQuery selector.
781 * @param {String} selector (optional) An Ext.ComponentQuery selector. If no selector is
782 * specified, the first child will be returned.
783 * @return Ext.Component
785 child : function(selector) {
786 selector = selector || '';
787 return this.query('> ' + selector)[0] || null;
790 <span id='Ext-container-AbstractContainer-method-down'> /**
791 </span> * Retrieves the first descendant of this container which matches the passed selector.
792 * The passed in selector must comply with an Ext.ComponentQuery selector.
793 * @param {String} selector (optional) An Ext.ComponentQuery selector. If no selector is
794 * specified, the first child will be returned.
795 * @return Ext.Component
797 down : function(selector) {
798 return this.query(selector)[0] || null;
803 this.callParent(arguments);
804 this.performDeferredLayouts();
808 // Lay out any descendant containers who queued a layout operation during the time this was hidden
809 // This is also called by Panel after it expands because descendants of a collapsed Panel allso queue any layout ops.
810 performDeferredLayouts: function() {
811 var layoutCollection = this.layoutOnShow,
812 ln = layoutCollection.getCount(),
817 for (; i < ln; i++) {
818 item = layoutCollection.get(i);
819 needsLayout = item.needsLayout;
821 if (Ext.isObject(needsLayout)) {
822 item.doComponentLayout(needsLayout.width, needsLayout.height, needsLayout.isSetSize, needsLayout.ownerCt);
825 layoutCollection.clear();
829 // Enable all immediate children that was previously disabled
830 onEnable: function() {
831 Ext.Array.each(this.query('[isFormField]'), function(item) {
832 if (item.resetDisable) {
834 delete item.resetDisable;
841 // Disable all immediate children that was previously disabled
842 onDisable: function() {
843 Ext.Array.each(this.query('[isFormField]'), function(item) {
844 if (item.resetDisable !== false && !item.disabled) {
846 item.resetDisable = true;
852 <span id='Ext-container-AbstractContainer-method-beforeLayout'> /**
853 </span> * Occurs before componentLayout is run. Returning false from this method will prevent the containerLayout
854 * from being executed.
856 beforeLayout: function() {
861 beforeDestroy : function() {
867 while ((c = items.first())) {
868 me.doRemove(c, true);