Upgrade to ExtJS 3.2.1 - Released 04/27/2010
[extjs.git] / examples / form / absform.js
1 /*!
2  * Ext JS Library 3.2.1
3  * Copyright(c) 2006-2010 Ext JS, Inc.
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 Ext.onReady(function() {
8     var form = new Ext.form.FormPanel({
9         baseCls: 'x-plain',
10         layout:'absolute',
11         url:'save-form.php',
12         defaultType: 'textfield',
13
14         items: [{
15             x: 0,
16             y: 5,
17             xtype:'label',
18             text: 'Send To:'
19         },{
20             x: 60,
21             y: 0,
22             name: 'to',
23             anchor:'100%'  // anchor width by percentage
24         },{
25             x: 0,
26             y: 35,
27             xtype:'label',
28             text: 'Subject:'
29         },{
30             x: 60,
31             y: 30,
32             name: 'subject',
33             anchor: '100%'  // anchor width by percentage
34         },{
35             x:0,
36             y: 60,
37             xtype: 'textarea',
38             name: 'msg',
39             anchor: '100% 100%'  // anchor width and height
40         }]
41     });
42
43     var window = new Ext.Window({
44         title: 'Resize Me',
45         width: 500,
46         height:300,
47         minWidth: 300,
48         minHeight: 200,
49         layout: 'fit',
50         plain:true,
51         bodyStyle:'padding:5px;',
52         buttonAlign:'center',
53         items: form,
54
55         buttons: [{
56             text: 'Send'
57         },{
58             text: 'Cancel'
59         }]
60     });
61
62     window.show();
63 });