Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / form / absform.js
1 Ext.require([
2     'Ext.form.*',
3     'Ext.layout.container.Absolute',
4     'Ext.window.Window'
5 ]);
6
7 Ext.onReady(function() {
8     var form = Ext.create('Ext.form.Panel', {
9         layout: 'absolute',
10         url: 'save-form.php',
11         defaultType: 'textfield',
12         border: false,
13
14         items: [{
15             fieldLabel: 'Send To',
16             fieldWidth: 60,
17             msgTarget: 'side',
18             allowBlank: false,
19             x: 5,
20             y: 5,
21             name: 'to',
22             anchor: '-5'  // anchor width by percentage
23         }, {
24             fieldLabel: 'Subject',
25             fieldWidth: 60,
26             x: 5,
27             y: 35,
28             name: 'subject',
29             anchor: '-5'  // anchor width by percentage
30         }, {
31             x:5,
32             y: 65,
33             xtype: 'textarea',
34             style: 'margin:0',
35             hideLabel: true,
36             name: 'msg',
37             anchor: '-5 -5'  // anchor width and height
38         }]
39     });
40
41     var win = Ext.create('Ext.window.Window', {
42         title: 'Resize Me',
43         width: 500,
44         height: 300,
45         minWidth: 300,
46         minHeight: 200,
47         layout: 'fit',
48         plain:true,
49         items: form,
50
51         buttons: [{
52             text: 'Send'
53         },{
54             text: 'Cancel'
55         }]
56     });
57
58     win.show();
59 });