1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-layout.container.Auto'>/**
2 </span> * @class Ext.layout.container.Auto
3 * @extends Ext.layout.container.Container
5 * <p>The AutoLayout is the default layout manager delegated by {@link Ext.container.Container} to
6 * render any child Components when no <tt>{@link Ext.container.Container#layout layout}</tt> is configured into
7 * a <tt>{@link Ext.container.Container Container}.</tt>. AutoLayout provides only a passthrough of any layout calls
8 * to any child containers.</p>
9 * {@img Ext.layout.container.Auto/Ext.layout.container.Auto.png Ext.layout.container.Auto container layout}
11 Ext.create('Ext.Panel', {
14 title: "AutoLayout Panel",
16 renderTo: document.body,
19 title: 'Top Inner Panel',
24 title: 'Bottom Inner Panel',
31 Ext.define('Ext.layout.container.Auto', {
33 /* Begin Definitions */
35 alias: ['layout.auto', 'layout.autocontainer'],
37 extend: 'Ext.layout.container.Container',
41 type: 'autocontainer',
45 bindToOwnerCtComponent: true,
48 onLayout : function(owner, target) {
50 items = me.getLayoutItems(),
54 // Ensure the Container is only primed with the clear element if there are child items.
56 // Auto layout uses natural HTML flow to arrange the child items.
57 // To ensure that all browsers (I'm looking at you IE!) add the bottom margin of the last child to the
58 // containing element height, we create a zero-sized element with style clear:both to force a "new line"
60 me.clearEl = me.getRenderTarget().createChild({
61 cls: Ext.baseCSSPrefix + 'clear',
66 // Auto layout allows CSS to size its child items.
67 for (i = 0; i < ln; i++) {
68 me.setItemSize(items[i]);
72 });</pre></pre></body></html>