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