Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / source / widgets / Container.js
diff --git a/source/widgets/Container.js b/source/widgets/Container.js
deleted file mode 100644 (file)
index 4ae92f7..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.Container\r
- * @extends Ext.BoxComponent\r
- * <p>Base class for any {@link Ext.BoxComponent} that can contain other components. The most commonly\r
- * used Container classes are {@link Ext.Panel}, {@link Ext.Window} and {@link Ext.TabPanel}, but you can\r
- * create a lightweight Container to encapsulate an HTML element that is created to your\r
- * specifications at render time by using the {@link Ext.Component#autoEl autoEl} config option\r
- * which takes the form of a {@link Ext.DomHelper DomHelper} specification. If you do not need\r
- * the capabilities offered by the above mentioned classes, for instance embedded\r
- * {@link Ext.layout.ColumnLayout column} layouts inside FormPanels, then this is a useful technique.</p>\r
- * <p>The code below illustrates both how to explicitly <i>create</i> a Container, and how to implicitly\r
- * create one using the <b><tt>'container'</tt></b> xtype:<pre><code>\r
-var embeddedColumns = new Ext.Container({\r
-    autoEl: {},\r
-    layout: 'column',\r
-    defaults: {\r
-        xtype: 'container',\r
-        autoEl: {},\r
-        layout: 'form',\r
-        columnWidth: 0.5,\r
-        style: {\r
-            padding: '10px'\r
-        }\r
-    },\r
-    items: [{\r
-        items: {\r
-            xtype: 'datefield',\r
-            name: 'startDate',\r
-            fieldLabel: 'Start date'\r
-        }\r
-    }, {\r
-        items: {\r
-            xtype: 'datefield',\r
-            name: 'endDate',\r
-            fieldLabel: 'End date'\r
-        }\r
-    }]\r
-});</code></pre></p>\r
- * Containers handle the basic behavior of containing items, namely adding, inserting and removing them.\r
- * The specific layout logic required to visually render contained items is delegated to any one of the different\r
- * {@link #layout} classes available.</p>\r
- * <p>When either specifying child {@link #items} of a Container, or dynamically adding components to a Container,\r
- * remember to consider how you wish the Container to arrange those child elements, and whether those child elements\r
- * need to be sized using one of Ext's built-in layout schemes.</p>\r
- * <p>By default, Containers use the {@link Ext.layout.ContainerLayout ContainerLayout} scheme. This simply renders\r
- * child components, appending them one after the other inside the Container, and does not apply any sizing at all.\r
- * This is a common source of confusion when widgets like GridPanels or TreePanels are added to Containers for\r
- * which no layout has been specified. If a Container is left to use the ContainerLayout scheme, none of its child\r
- * components will be resized, or changed in any way when the Container is resized.</p>\r
- * <p>A very common example of this is where a developer will attempt to add a GridPanel to a TabPanel by wrapping\r
- * the GridPanel <i>inside</i> a wrapping Panel and add that wrapping Panel to the TabPanel. This misses the point that\r
- * Ext's inheritance means that a GridPanel <b>is</b> a Component which can be added unadorned into a Container. If\r
- * that wrapping Panel has no layout configuration, then the GridPanel will not be sized as expected.<p>\r
- * <p>Below is an example of adding a newly created GridPanel to a TabPanel. A TabPanel uses {@link Ext.layout.CardLayout}\r
- * as its layout manager which means all its child items are sized to fit exactly into its client area. The following\r
- * code requires prior knowledge of how to create GridPanels. See {@link Ext.grid.GridPanel}, {@link Ext.data.Store}\r
- * and {@link Ext.data.JsonReader} as well as the grid examples in the Ext installation's <tt>examples/grid</tt>\r
- * directory.</p><pre><code>\r
-//  Create the GridPanel.\r
-myGrid = new Ext.grid.GridPanel({\r
-    store: myStore,\r
-    columns: myColumnModel,\r
-    title: 'Results',\r
-});\r
-\r
-myTabPanel.add(myGrid);\r
-myTabPanel.setActiveTab(myGrid);\r
-</code></pre>\r
- */\r
-Ext.Container = Ext.extend(Ext.BoxComponent, {\r
-    /** @cfg {Boolean} monitorResize\r
-     * True to automatically monitor window resize events to handle anything that is sensitive to the current size\r
-     * of the viewport.  This value is typically managed by the chosen {@link #layout} and should not need to be set manually.\r
-     */\r
-    /**\r
-     * @cfg {String} layout\r
-     * The layout type to be used in this container.  If not specified, a default {@link Ext.layout.ContainerLayout}\r
-     * will be created and used. Specific config values for the chosen layout type can be specified using \r
-     * {@link #layoutConfig}. Valid values are:<ul class="mdetail-params">\r
-     * <li>absolute</li>\r
-     * <li>accordion</li>\r
-     * <li>anchor</li>\r
-     * <li>border</li>\r
-     * <li>card</li>\r
-     * <li>column</li>\r
-     * <li>fit</li>\r
-     * <li>form</li>\r
-     * <li>table</li></ul>\r
-     */\r
-    /**\r
-     * @cfg {Object} layoutConfig\r
-     * This is a config object containing properties specific to the chosen layout (to be used in conjunction with\r
-     * the {@link #layout} config value).  For complete details regarding the valid config options for each layout\r
-     * type, see the layout class corresponding to the type specified:<ul class="mdetail-params">\r
-     * <li>{@link Ext.layout.Absolute}</li>\r
-     * <li>{@link Ext.layout.Accordion}</li>\r
-     * <li>{@link Ext.layout.AnchorLayout}</li>\r
-     * <li>{@link Ext.layout.BorderLayout}</li>\r
-     * <li>{@link Ext.layout.CardLayout}</li>\r
-     * <li>{@link Ext.layout.ColumnLayout}</li>\r
-     * <li>{@link Ext.layout.FitLayout}</li>\r
-     * <li>{@link Ext.layout.FormLayout}</li>\r
-     * <li>{@link Ext.layout.TableLayout}</li></ul>\r
-     */\r
-    /**\r
-     * @cfg {Boolean/Number} bufferResize\r
-     * When set to true (100 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer\r
-     * the frequency it calculates and does a re-layout of components. This is useful for heavy containers or containers\r
-     * with a large quantity of sub-components for which frequent layout calls would be expensive.\r
-     */\r
-    /**\r
-     * @cfg {String/Number} activeItem\r
-     * A string component id or the numeric index of the component that should be initially activated within the\r
-     * container's layout on render.  For example, activeItem: 'item-1' or activeItem: 0 (index 0 = the first\r
-     * item in the container's collection).  activeItem only applies to layout styles that can display\r
-     * items one at a time (like {@link Ext.layout.Accordion}, {@link Ext.layout.CardLayout} and\r
-     * {@link Ext.layout.FitLayout}).  Related to {@link Ext.layout.ContainerLayout#activeItem}.\r
-     */\r
-    /**\r
-     * @cfg {Mixed} items\r
-     * A single item, or an array of child Components to be added to this container.\r
-     * Each item can be any type of object based on {@link Ext.Component}.<br><br>\r
-     * Component config objects may also be specified in order to avoid the overhead\r
-     * of constructing a real Component object if lazy rendering might mean that the\r
-     * added Component will not be rendered immediately. To take advantage of this\r
-     * "lazy instantiation", set the {@link Ext.Component#xtype} config property to\r
-     * the registered type of the Component wanted.<br><br>\r
-     * For a list of all available xtypes, see {@link Ext.Component}.\r
-     * If a single item is being passed, it should be passed directly as an object\r
-     * reference (e.g., items: {...}).  Multiple items should be passed as an array\r
-     * of objects (e.g., items: [{...}, {...}]).\r
-     */\r
-    /**\r
-     * @cfg {Object} defaults\r
-     * A config object that will be applied to all components added to this container either via the {@link #items}\r
-     * config or via the {@link #add} or {@link #insert} methods.  The defaults config can contain any number of\r
-     * name/value property pairs to be added to each item, and should be valid for the types of items\r
-     * being added to the container.  For example, to automatically apply padding to the body of each of a set of\r
-     * contained {@link Ext.Panel} items, you could pass: defaults: {bodyStyle:'padding:15px'}.\r
-     */\r
-\r
-    /** @cfg {Boolean} autoDestroy\r
-     * If true the container will automatically destroy any contained component that is removed from it, else\r
-     * destruction must be handled manually (defaults to true).\r
-     */\r
-    autoDestroy: true,\r
-    /** @cfg {Boolean} hideBorders\r
-     * True to hide the borders of each contained component, false to defer to the component's existing\r
-     * border settings (defaults to false).\r
-     */\r
-    /** @cfg {String} defaultType\r
-     * <p>The default {@link Ext.Component xtype} of child Components to create in this Container when\r
-     * a child item is specified as a raw configuration object, rather than as an instantiated Component.</p>\r
-     * <p>Defaults to 'panel'.</p>\r
-     */\r
-    defaultType: 'panel',\r
-\r
-    // private\r
-    initComponent : function(){\r
-        Ext.Container.superclass.initComponent.call(this);\r
-\r
-        this.addEvents(\r
-            /**\r
-             * @event afterlayout\r
-             * Fires when the components in this container are arranged by the associated layout manager.\r
-             * @param {Ext.Container} this\r
-             * @param {ContainerLayout} layout The ContainerLayout implementation for this container\r
-             */\r
-            'afterlayout',\r
-            /**\r
-             * @event beforeadd\r
-             * Fires before any {@link Ext.Component} is added or inserted into the container.\r
-             * A handler can return false to cancel the add.\r
-             * @param {Ext.Container} this\r
-             * @param {Ext.Component} component The component being added\r
-             * @param {Number} index The index at which the component will be added to the container's items collection\r
-             */\r
-            'beforeadd',\r
-            /**\r
-             * @event beforeremove\r
-             * Fires before any {@link Ext.Component} is removed from the container.  A handler can return\r
-             * false to cancel the remove.\r
-             * @param {Ext.Container} this\r
-             * @param {Ext.Component} component The component being removed\r
-             */\r
-            'beforeremove',\r
-            /**\r
-             * @event add\r
-             * Fires after any {@link Ext.Component} is added or inserted into the container.\r
-             * @param {Ext.Container} this\r
-             * @param {Ext.Component} component The component that was added\r
-             * @param {Number} index The index at which the component was added to the container's items collection\r
-             */\r
-            'add',\r
-            /**\r
-             * @event remove\r
-             * Fires after any {@link Ext.Component} is removed from the container.\r
-             * @param {Ext.Container} this\r
-             * @param {Ext.Component} component The component that was removed\r
-             */\r
-            'remove'\r
-        );\r
-\r
-        /**\r
-         * The collection of components in this container as a {@link Ext.util.MixedCollection}\r
-         * @type MixedCollection\r
-         * @property items\r
-         */\r
-        var items = this.items;\r
-        if(items){\r
-            delete this.items;\r
-            if(Ext.isArray(items) && items.length > 0){\r
-                this.add.apply(this, items);\r
-            }else{\r
-                this.add(items);\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    initItems : function(){\r
-        if(!this.items){\r
-            this.items = new Ext.util.MixedCollection(false, this.getComponentId);\r
-            this.getLayout(); // initialize the layout\r
-        }\r
-    },\r
-\r
-    // private\r
-    setLayout : function(layout){\r
-        if(this.layout && this.layout != layout){\r
-            this.layout.setContainer(null);\r
-        }\r
-        this.initItems();\r
-        this.layout = layout;\r
-        layout.setContainer(this);\r
-    },\r
-\r
-    // private\r
-    render : function(){\r
-        Ext.Container.superclass.render.apply(this, arguments);\r
-        if(this.layout){\r
-            if(typeof this.layout == 'string'){\r
-                this.layout = new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig);\r
-            }\r
-            this.setLayout(this.layout);\r
-\r
-            if(this.activeItem !== undefined){\r
-                var item = this.activeItem;\r
-                delete this.activeItem;\r
-                this.layout.setActiveItem(item);\r
-                return;\r
-            }\r
-        }\r
-        if(!this.ownerCt){\r
-            this.doLayout();\r
-        }\r
-        if(this.monitorResize === true){\r
-            Ext.EventManager.onWindowResize(this.doLayout, this, [false]);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * <p>Returns the Element to be used to contain the child Components of this Container.</p>\r
-     * <p>An implementation is provided which returns the Container's {@link #getEl Element}, but\r
-     * if there is a more complex structure to a Container, this may be overridden to return\r
-     * the element into which the {@link #layout layout} renders child Components.</p>\r
-     * @return {Ext.Element} The Element to render child Components into.\r
-     */\r
-    getLayoutTarget : function(){\r
-        return this.el;\r
-    },\r
-\r
-    // private - used as the key lookup function for the items collection\r
-    getComponentId : function(comp){\r
-        return comp.itemId || comp.id;\r
-    },\r
-\r
-    /**\r
-     * <p>Adds a {@link Ext.Component Component} to this Container. Fires the {@link #beforeadd} event before\r
-     * adding, then fires the {@link #add} event after the component has been added.</p>\r
-     * <p>You will never call the render method of a child Component when using a Container.\r
-     * Child Components are rendered by this Container's {@link #layout} manager when\r
-     * this Container is first rendered.</p>\r
-     * <p>Certain layout managers allow dynamic addition of child components. Those that do\r
-     * include {@link Ext.layout.CardLayout}, {@link Ext.layout.AnchorLayout},\r
-     * {@link Ext.layout.FormLayout}, {@link Ext.layout.TableLayout}.</p>\r
-     * <p>If the Container is already rendered when add is called, you may need to call\r
-     * {@link #doLayout} to refresh the view which causes any unrendered child Components\r
-     * to be rendered. This is required so that you can add multiple child components if needed\r
-     * while only refreshing the layout once.</p>\r
-     * <p>When creating complex UIs, it is important to remember that sizing and positioning\r
-     * of child items is the responsibility of the Container's {@link #layout} manager. If\r
-     * you expect child items to be sized in response to user interactions, you must\r
-     * specify a layout manager which creates and manages the type of layout you have in mind.</p>\r
-     * <p><b>Omitting the {@link #layout} config means that a basic layout manager is\r
-     * used which does nothnig but render child components sequentially into the Container.\r
-     * No sizing or positioning will be performed in this situation.</b></p>\r
-     * @param {Ext.Component/Object} component The Component to add.<br><br>\r
-     * Ext uses lazy rendering, and will only render the added Component should\r
-     * it become necessary, that is: when the Container is layed out either on first render\r
-     * or in response to a {@link #doLayout} call.<br><br>\r
-     * A Component config object may be passed instead of an instantiated Component object.\r
-     * The type of Component created from a config object is determined by the {@link Ext.Component#xtype xtype}\r
-     * config property. If no xtype is configured, the Container's {@link #defaultType}\r
-     * is used.<br><br>\r
-     * For a list of all available xtypes, see {@link Ext.Component}.\r
-     * @return {Ext.Component} component The Component (or config object) that was\r
-     * added with the Container's default config values applied.\r
-     * <p>example:</p><pre><code>\r
-var myNewGrid = new Ext.grid.GridPanel({\r
-    store: myStore,\r
-    colModel: myColModel\r
-});\r
-myTabPanel.add(myNewGrid);\r
-myTabPanel.setActiveTab(myNewGrid);\r
-</code></pre>\r
-     */\r
-    add : function(comp){\r
-        if(!this.items){\r
-            this.initItems();\r
-        }\r
-        var a = arguments, len = a.length;\r
-        if(len > 1){\r
-            for(var i = 0; i < len; i++) {\r
-                this.add(a[i]);\r
-            }\r
-            return;\r
-        }\r
-        var c = this.lookupComponent(this.applyDefaults(comp));\r
-        var pos = this.items.length;\r
-        if(this.fireEvent('beforeadd', this, c, pos) !== false && this.onBeforeAdd(c) !== false){\r
-            this.items.add(c);\r
-            c.ownerCt = this;\r
-            this.fireEvent('add', this, c, pos);\r
-        }\r
-        return c;\r
-    },\r
-\r
-    /**\r
-     * Inserts a Component into this Container at a specified index. Fires the\r
-     * {@link #beforeadd} event before inserting, then fires the {@link #add} event after the\r
-     * Component has been inserted.\r
-     * @param {Number} index The index at which the Component will be inserted\r
-     * into the Container's items collection\r
-     * @param {Ext.Component} component The child Component to insert.<br><br>\r
-     * Ext uses lazy rendering, and will only render the inserted Component should\r
-     * it become necessary.<br><br>\r
-     * A Component config object may be passed in order to avoid the overhead of\r
-     * constructing a real Component object if lazy rendering might mean that the\r
-     * inserted Component will not be rendered immediately. To take advantage of\r
-     * this "lazy instantiation", set the {@link Ext.Component#xtype} config\r
-     * property to the registered type of the Component wanted.<br><br>\r
-     * For a list of all available xtypes, see {@link Ext.Component}.\r
-     * @return {Ext.Component} component The Component (or config object) that was\r
-     * inserted with the Container's default config values applied.\r
-     */\r
-    insert : function(index, comp){\r
-        if(!this.items){\r
-            this.initItems();\r
-        }\r
-        var a = arguments, len = a.length;\r
-        if(len > 2){\r
-            for(var i = len-1; i >= 1; --i) {\r
-                this.insert(index, a[i]);\r
-            }\r
-            return;\r
-        }\r
-        var c = this.lookupComponent(this.applyDefaults(comp));\r
-\r
-        if(c.ownerCt == this && this.items.indexOf(c) < index){\r
-            --index;\r
-        }\r
-\r
-        if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){\r
-            this.items.insert(index, c);\r
-            c.ownerCt = this;\r
-            this.fireEvent('add', this, c, index);\r
-        }\r
-        return c;\r
-    },\r
-\r
-    // private\r
-    applyDefaults : function(c){\r
-        if(this.defaults){\r
-            if(typeof c == 'string'){\r
-                c = Ext.ComponentMgr.get(c);\r
-                Ext.apply(c, this.defaults);\r
-            }else if(!c.events){\r
-                Ext.applyIf(c, this.defaults);\r
-            }else{\r
-                Ext.apply(c, this.defaults);\r
-            }\r
-        }\r
-        return c;\r
-    },\r
-\r
-    // private\r
-    onBeforeAdd : function(item){\r
-        if(item.ownerCt){\r
-            item.ownerCt.remove(item, false);\r
-        }\r
-        if(this.hideBorders === true){\r
-            item.border = (item.border === true);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Removes a component from this container.  Fires the {@link #beforeremove} event before removing, then fires\r
-     * the {@link #remove} event after the component has been removed.\r
-     * @param {Component/String} component The component reference or id to remove.\r
-     * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.\r
-     * Defaults to the value of this Container's {@link #autoDestroy} config.\r
-     * @return {Ext.Component} component The Component that was removed.\r
-     */\r
-    remove : function(comp, autoDestroy){\r
-        var c = this.getComponent(comp);\r
-        if(c && this.fireEvent('beforeremove', this, c) !== false){\r
-            this.items.remove(c);\r
-            delete c.ownerCt;\r
-            if(autoDestroy === true || (autoDestroy !== false && this.autoDestroy)){\r
-                c.destroy();\r
-            }\r
-            if(this.layout && this.layout.activeItem == c){\r
-                delete this.layout.activeItem;\r
-            }\r
-            this.fireEvent('remove', this, c);\r
-        }\r
-        return c;\r
-    },\r
-    \r
-    /**\r
-     * Removes all components from this container.\r
-     * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.\r
-     * Defaults to the value of this Container's {@link #autoDestroy} config.\r
-     * @return {Array} Array of the destroyed components\r
-     */\r
-    removeAll: function(autoDestroy){\r
-        var item, items = [];\r
-        while((item = this.items.last())){\r
-            items.unshift(this.remove(item, autoDestroy));\r
-        }\r
-        return items;\r
-    },\r
-\r
-    /**\r
-     * Gets a direct child Component by id, or by index.\r
-     * @param {String/Number} id or index of child Component to return.\r
-     * @return Ext.Component\r
-     */\r
-    getComponent : function(comp){\r
-        if(typeof comp == 'object'){\r
-            return comp;\r
-        }\r
-        return this.items.get(comp);\r
-    },\r
-\r
-    // private\r
-    lookupComponent : function(comp){\r
-        if(typeof comp == 'string'){\r
-            return Ext.ComponentMgr.get(comp);\r
-        }else if(!comp.events){\r
-            return this.createComponent(comp);\r
-        }\r
-        return comp;\r
-    },\r
-\r
-    // private\r
-    createComponent : function(config){\r
-        return Ext.ComponentMgr.create(config, this.defaultType);\r
-    },\r
-\r
-    /**\r
-     * Force this container's layout to be recalculated. A call to this function is required after adding a new component\r
-     * to an already rendered container, or possibly after changing sizing/position properties of child components.\r
-     * @param {Boolean} shallow (optional) True to only calc the layout of this component, and let child components auto\r
-     * calc layouts as required (defaults to false, which calls doLayout recursively for each subcontainer)\r
-     */\r
-    doLayout : function(shallow){\r
-        if(this.rendered && this.layout){\r
-            this.layout.layout();\r
-        }\r
-        if(shallow !== false && this.items){\r
-            var cs = this.items.items;\r
-            for(var i = 0, len = cs.length; i < len; i++) {\r
-                var c  = cs[i];\r
-                if(c.doLayout){\r
-                    c.doLayout();\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Returns the layout currently in use by the container.  If the container does not currently have a layout\r
-     * set, a default {@link Ext.layout.ContainerLayout} will be created and set as the container's layout.\r
-     * @return {ContainerLayout} layout The container's layout\r
-     */\r
-    getLayout : function(){\r
-        if(!this.layout){\r
-            var layout = new Ext.layout.ContainerLayout(this.layoutConfig);\r
-            this.setLayout(layout);\r
-        }\r
-        return this.layout;\r
-    },\r
-\r
-    // private\r
-    beforeDestroy : function(){\r
-        if(this.items){\r
-            Ext.destroy.apply(Ext, this.items.items);\r
-        }\r
-        if(this.monitorResize){\r
-            Ext.EventManager.removeResizeListener(this.doLayout, this);\r
-        }\r
-        if (this.layout && this.layout.destroy) {\r
-            this.layout.destroy();\r
-        }\r
-        Ext.Container.superclass.beforeDestroy.call(this);\r
-    },\r
-\r
-    /**\r
-     * Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<i>this</i>) of\r
-     * function call will be the scope provided or the current component. The arguments to the function\r
-     * will be the args provided or the current component. If the function returns false at any point,\r
-     * the bubble is stopped.\r
-     * @param {Function} fn The function to call\r
-     * @param {Object} scope (optional) The scope of the function (defaults to current node)\r
-     * @param {Array} args (optional) The args to call the function with (default to passing the current component)\r
-     */\r
-    bubble : function(fn, scope, args){\r
-        var p = this;\r
-        while(p){\r
-            if(fn.apply(scope || p, args || [p]) === false){\r
-                break;\r
-            }\r
-            p = p.ownerCt;\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Cascades down the component/container heirarchy from this component (called first), calling the specified function with\r
-     * each component. The scope (<i>this</i>) of\r
-     * function call will be the scope provided or the current component. The arguments to the function\r
-     * will be the args provided or the current component. If the function returns false at any point,\r
-     * the cascade is stopped on that branch.\r
-     * @param {Function} fn The function to call\r
-     * @param {Object} scope (optional) The scope of the function (defaults to current component)\r
-     * @param {Array} args (optional) The args to call the function with (defaults to passing the current component)\r
-     */\r
-    cascade : function(fn, scope, args){\r
-        if(fn.apply(scope || this, args || [this]) !== false){\r
-            if(this.items){\r
-                var cs = this.items.items;\r
-                for(var i = 0, len = cs.length; i < len; i++){\r
-                    if(cs[i].cascade){\r
-                        cs[i].cascade(fn, scope, args);\r
-                    }else{\r
-                        fn.apply(scope || cs[i], args || [cs[i]]);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Find a component under this container at any level by id\r
-     * @param {String} id\r
-     * @return Ext.Component\r
-     */\r
-    findById : function(id){\r
-        var m, ct = this;\r
-        this.cascade(function(c){\r
-            if(ct != c && c.id === id){\r
-                m = c;\r
-                return false;\r
-            }\r
-        });\r
-        return m || null;\r
-    },\r
-\r
-    /**\r
-     * Find a component under this container at any level by xtype or class\r
-     * @param {String/Class} xtype The xtype string for a component, or the class of the component directly\r
-     * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is\r
-     * the default), or true to check whether this Component is directly of the specified xtype.\r
-     * @return {Array} Array of Ext.Components\r
-     */\r
-    findByType : function(xtype, shallow){\r
-        return this.findBy(function(c){\r
-            return c.isXType(xtype, shallow);\r
-        });\r
-    },\r
-\r
-    /**\r
-     * Find a component under this container at any level by property\r
-     * @param {String} prop\r
-     * @param {String} value\r
-     * @return {Array} Array of Ext.Components\r
-     */\r
-    find : function(prop, value){\r
-        return this.findBy(function(c){\r
-            return c[prop] === value;\r
-        });\r
-    },\r
-\r
-    /**\r
-     * Find a component under this container at any level by a custom function. If the passed function returns\r
-     * true, the component will be included in the results. The passed function is called with the arguments (component, this container).\r
-     * @param {Function} fcn\r
-     * @param {Object} scope (optional)\r
-     * @return {Array} Array of Ext.Components\r
-     */\r
-    findBy : function(fn, scope){\r
-        var m = [], ct = this;\r
-        this.cascade(function(c){\r
-            if(ct != c && fn.call(scope || c, c, ct) === true){\r
-                m.push(c);\r
-            }\r
-        });\r
-        return m;\r
-    }\r
-});\r
-\r
-Ext.Container.LAYOUTS = {};\r
-Ext.reg('container', Ext.Container);
\ No newline at end of file