Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / anchoring.html
1 <html>\r
2 <head>\r
3   <title>The source code</title>\r
4     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
5     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
6 </head>\r
7 <body  onload="prettyPrint();">\r
8     <pre class="prettyprint lang-js">Ext.onReady(function() {\r
9     var form = new Ext.form.FormPanel({\r
10         baseCls: 'x-plain',\r
11         labelWidth: 55,\r
12         url:'save-form.php',\r
13         defaultType: 'textfield',\r
14 \r
15         items: [{\r
16             fieldLabel: 'Send To',\r
17             name: 'to',\r
18             anchor:'100%'  // anchor width by percentage\r
19         },{\r
20             fieldLabel: 'Subject',\r
21             name: 'subject',\r
22             anchor: '100%'  // anchor width by percentage\r
23         }, {\r
24             xtype: 'textarea',\r
25             hideLabel: true,\r
26             name: 'msg',\r
27             anchor: '100% -53'  // anchor width by percentage and height by raw adjustment\r
28         }]\r
29     });\r
30 \r
31     var window = new Ext.Window({\r
32         title: 'Resize Me',\r
33         width: 500,\r
34         height:300,\r
35         minWidth: 300,\r
36         minHeight: 200,\r
37         layout: 'fit',\r
38         plain:true,\r
39         bodyStyle:'padding:5px;',\r
40         buttonAlign:'center',\r
41         items: form,\r
42 \r
43         buttons: [{\r
44             text: 'Send'\r
45         },{\r
46             text: 'Cancel'\r
47         }]\r
48     });\r
49 \r
50     window.show();\r
51 });</pre>    \r
52 </body>\r
53 </html>