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-layout-container-Auto'>/**
19 </span> * @class Ext.layout.container.Auto
20 * @extends Ext.layout.container.Container
22 * The AutoLayout is the default layout manager delegated by {@link Ext.container.Container} to
23 * render any child Components when no `{@link Ext.container.Container#layout layout}` is configured into
24 * a `{@link Ext.container.Container Container}.` AutoLayout provides only a passthrough of any layout calls
25 * to any child containers.
28 * Ext.create('Ext.Panel', {
31 * title: "AutoLayout Panel",
33 * renderTo: document.body,
36 * title: 'Top Inner Panel',
42 * 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',
60 bindToOwnerCtComponent: true,
63 onLayout : function(owner, target) {
65 items = me.getLayoutItems(),
69 // Ensure the Container is only primed with the clear element if there are child items.
71 // Auto layout uses natural HTML flow to arrange the child items.
72 // To ensure that all browsers (I'm looking at you IE!) add the bottom margin of the last child to the
73 // containing element height, we create a zero-sized element with style clear:both to force a "new line"
75 me.clearEl = me.getRenderTarget().createChild({
76 cls: Ext.baseCSSPrefix + 'clear',
81 // Auto layout allows CSS to size its child items.
82 for (i = 0; i < ln; i++) {
83 me.setItemSize(items[i]);
88 configureItem: function(item) {
89 this.callParent(arguments);
91 // Auto layout does not manage any dimensions.
92 item.layoutManagedHeight = 2;
93 item.layoutManagedWidth = 2;