Upgrade to ExtJS 3.2.0 - Released 03/30/2010
[extjs.git] / src / widgets / layout / AutoLayout.js
1 /*!
2  * Ext JS Library 3.2.0
3  * Copyright(c) 2006-2010 Ext JS, Inc.
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 /**
8  * @class Ext.layout.AutoLayout
9  * <p>The AutoLayout is the default layout manager delegated by {@link Ext.Container} to
10  * render any child Components when no <tt>{@link Ext.Container#layout layout}</tt> is configured into
11  * a {@link Ext.Container Container}.</tt>.  AutoLayout provides only a passthrough of any layout calls
12  * to any child containers.</p>
13  */
14 Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, {
15     type: 'auto',
16
17     monitorResize: true,
18
19     onLayout : function(ct, target){
20         Ext.layout.AutoLayout.superclass.onLayout.call(this, ct, target);
21         var cs = this.getRenderedItems(ct), len = cs.length, i, c;
22         for(i = 0; i < len; i++){
23             c = cs[i];
24             if (c.doLayout){
25                 // Shallow layout children
26                 c.doLayout(true);
27             }
28         }
29     }
30 });
31
32 Ext.Container.LAYOUTS['auto'] = Ext.layout.AutoLayout;