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-VBox'>/**
19 </span> * @class Ext.layout.container.VBox
20 * @extends Ext.layout.container.Box
21 * <p>A layout that arranges items vertically down a Container. This layout optionally divides available vertical
22 * space between child items containing a numeric <code>flex</code> configuration.</p>
23 * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
24 * {@img Ext.layout.container.VBox/Ext.layout.container.VBox.png Ext.layout.container.VBox container layout}
26 Ext.create('Ext.Panel', {
29 title: "VBoxLayout Panel",
34 renderTo: document.body,
37 title: 'Inner Panel One',
42 title: 'Inner Panel Two',
47 title: 'Inner Panel Three',
53 Ext.define('Ext.layout.container.VBox', {
55 /* Begin Definitions */
57 alias: ['layout.vbox'],
58 extend: 'Ext.layout.container.Box',
59 alternateClassName: 'Ext.layout.VBoxLayout',
63 <span id='Ext-layout-container-VBox-cfg-align'> /**
64 </span> * @cfg {String} align
65 * Controls how the child items of the container are aligned. Acceptable configuration values for this
67 * <div class="mdetail-params"><ul>
68 * <li><b><tt>left</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned horizontally
69 * at the <b>left</b> side of the container</div></li>
70 * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are aligned horizontally at the
71 * <b>mid-width</b> of the container</div></li>
72 * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched horizontally to fill
73 * the width of the container</div></li>
74 * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched horizontally to
75 * the size of the largest item.</div></li>
76 * </ul></div>
78 align : 'left', // left, center, stretch, strechmax
81 alignCenteringString: 'center',
85 direction: 'vertical',
87 // When creating an argument list to setSize, use this order
89 perpendicularSizeIndex: 0,
91 parallelPrefix: 'height',
92 parallelPrefixCap: 'Height',
95 parallelBefore: 'top',
96 parallelBeforeCap: 'Top',
97 parallelAfter: 'bottom',
98 parallelPosition: 'y',
100 perpendicularPrefix: 'width',
101 perpendicularPrefixCap: 'Width',
102 perpendicularLT: 'l',
103 perpendicularRB: 'r',
104 perpendicularLeftTop: 'left',
105 perpendicularRightBottom: 'right',
106 perpendicularPosition: 'x',
107 configureItem: function(item) {
109 item.layoutManagedHeight = 1;
111 item.layoutManagedHeight = 2;
114 if (this.align === 'stretch' || this.align === 'stretchmax') {
115 item.layoutManagedWidth = 1;
117 item.layoutManagedWidth = 2;
119 this.callParent(arguments);