]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * This example shows how to use vbox layout with Ext JS Forms.\r | |
3 | */\r | |
4 | Ext.define('KitchenSink.view.form.VBoxLayoutForm', {\r | |
5 | extend: 'Ext.window.Window',\r | |
6 | xtype: 'form-vboxlayout',\r | |
7 | \r | |
8 | //<example>\r | |
9 | requires: [\r | |
10 | 'Ext.form.field.Text',\r | |
11 | 'Ext.form.field.TextArea',\r | |
12 | 'Ext.layout.container.VBox'\r | |
13 | ],\r | |
14 | \r | |
15 | exampleTitle: 'VBox Layout Form',\r | |
16 | //</example>\r | |
17 | \r | |
18 | title: 'Resize Me',\r | |
19 | width: 500,\r | |
20 | height: 300,\r | |
21 | minWidth: 300,\r | |
22 | minHeight: 220,\r | |
23 | layout: 'fit',\r | |
24 | plain: true,\r | |
25 | \r | |
26 | items: [{\r | |
27 | xtype: 'form',\r | |
28 | \r | |
29 | defaultType: 'textfield',\r | |
30 | fieldDefaults: {\r | |
31 | labelWidth: 60\r | |
32 | },\r | |
33 | \r | |
34 | layout: {\r | |
35 | type: 'vbox',\r | |
36 | align: 'stretch'\r | |
37 | },\r | |
38 | \r | |
39 | bodyPadding: 5,\r | |
40 | border: false,\r | |
41 | \r | |
42 | items: [{\r | |
43 | fieldLabel: 'Send To',\r | |
44 | name: 'to'\r | |
45 | }, {\r | |
46 | fieldLabel: 'Subject',\r | |
47 | name: 'subject'\r | |
48 | }, {\r | |
49 | xtype: 'textarea',\r | |
50 | hideLabel: true,\r | |
51 | name: 'msg',\r | |
52 | \r | |
53 | // Setting flex to 1 for textarea when no other component has flex\r | |
54 | // is effectively tells the layout to strech the textarea vertically,\r | |
55 | // taking all the space left after the fields above have been laid out.\r | |
56 | flex: 1\r | |
57 | }]\r | |
58 | }],\r | |
59 | \r | |
60 | buttons: [{\r | |
61 | text: 'Send'\r | |
62 | },{\r | |
63 | text: 'Cancel'\r | |
64 | }]\r | |
65 | });\r |