]> git.proxmox.com Git - extjs.git/blame - extjs/examples/kitchensink/classic/samples/view/form/HBoxLayoutForm.js
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / kitchensink / classic / samples / view / form / HBoxLayoutForm.js
CommitLineData
6527f429
DM
1/**\r
2 * In the following example, the space needed for the email validation error message is\r
3 * taken automatically from the field size when needed. The mousedown event is being used\r
4 * for validation for more immediate feedback. Also note that the FormPanel itself is\r
5 * using an HBox layout.\r
6 */\r
7Ext.define('KitchenSink.view.form.HBoxLayoutForm', {\r
8 extend: 'Ext.form.Panel',\r
9 xtype: 'form-hboxlayout',\r
10 \r
11 //<example>\r
12 requires: [\r
13 'Ext.layout.container.Anchor',\r
14 'Ext.layout.container.HBox'\r
15 ],\r
16 \r
17 exampleTitle: 'HBox Layout Form',\r
18 //</example>\r
19\r
20 title: 'HBox Form Panel',\r
21 bodyPadding: '5 5 0',\r
22 width: 600,\r
23 \r
24 fieldDefaults: {\r
25 labelAlign: 'top',\r
26 msgTarget: 'side'\r
27 },\r
28 \r
29 defaults: {\r
30 border: false,\r
31 xtype: 'panel',\r
32 flex: 1,\r
33 layout: 'anchor'\r
34 },\r
35\r
36 layout: 'hbox',\r
37 \r
38 items: [{\r
39 items: [{\r
40 xtype: 'textfield',\r
41 fieldLabel: 'First Name',\r
42 anchor: '-5',\r
43 name: 'first'\r
44 }, {\r
45 xtype:'textfield',\r
46 fieldLabel: 'Company',\r
47 anchor: '-5',\r
48 name: 'company'\r
49 }]\r
50 }, {\r
51 items: [{\r
52 xtype: 'textfield',\r
53 fieldLabel: 'Last Name',\r
54 anchor: '100%',\r
55 name: 'last'\r
56 },{\r
57 xtype: 'textfield',\r
58 fieldLabel: 'Email',\r
59 anchor: '100%',\r
60 name: 'email',\r
61 vtype: 'email'\r
62 }]\r
63 }],\r
64 \r
65 buttons: ['->', {\r
66 text: 'Save'\r
67 }, {\r
68 text: 'Cancel'\r
69 }]\r
70});\r