4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../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-layout-container-Auto'>/**
19 </span> * @class Ext.layout.container.Auto
20 * @extends Ext.layout.container.Container
22 * <p>The AutoLayout is the default layout manager delegated by {@link Ext.container.Container} to
23 * render any child Components when no <tt>{@link Ext.container.Container#layout layout}</tt> is configured into
24 * a <tt>{@link Ext.container.Container Container}.</tt>. AutoLayout provides only a passthrough of any layout calls
25 * to any child containers.</p>
26 * {@img Ext.layout.container.Auto/Ext.layout.container.Auto.png Ext.layout.container.Auto container layout}
28 Ext.create('Ext.Panel', {
31 title: "AutoLayout Panel",
33 renderTo: document.body,
36 title: 'Top Inner Panel',
41 title: 'Bottom Inner Panel',
48 Ext.define('Ext.layout.container.Auto', {
50 /* Begin Definitions */
52 alias: ['layout.auto', 'layout.autocontainer'],
54 extend: 'Ext.layout.container.Container',
58 type: 'autocontainer',
62 bindToOwnerCtComponent: true,
65 onLayout : function(owner, target) {
67 items = me.getLayoutItems(),
71 // Ensure the Container is only primed with the clear element if there are child items.
73 // Auto layout uses natural HTML flow to arrange the child items.
74 // To ensure that all browsers (I'm looking at you IE!) add the bottom margin of the last child to the
75 // containing element height, we create a zero-sized element with style clear:both to force a "new line"
77 me.clearEl = me.getRenderTarget().createChild({
78 cls: Ext.baseCSSPrefix + 'clear',
83 // Auto layout allows CSS to size its child items.
84 for (i = 0; i < ln; i++) {
85 me.setItemSize(items[i]);