Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / examples / window / hello.js
1 /*!
2  * Ext JS Library 3.1.1
3  * Copyright(c) 2006-2010 Ext JS, LLC
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 Ext.onReady(function(){\r
8     var win;\r
9     var button = Ext.get('show-btn');\r
10 \r
11     button.on('click', function(){\r
12         // create the window on the first click and reuse on subsequent clicks\r
13         if(!win){\r
14             win = new Ext.Window({\r
15                 applyTo:'hello-win',\r
16                 layout:'fit',\r
17                 width:500,\r
18                 height:300,\r
19                 closeAction:'hide',\r
20                 plain: true,\r
21 \r
22                 items: new Ext.TabPanel({\r
23                     applyTo: 'hello-tabs',\r
24                     autoTabs:true,\r
25                     activeTab:0,\r
26                     deferredRender:false,\r
27                     border:false\r
28                 }),\r
29 \r
30                 buttons: [{\r
31                     text:'Submit',\r
32                     disabled:true\r
33                 },{\r
34                     text: 'Close',\r
35                     handler: function(){\r
36                         win.hide();\r
37                     }\r
38                 }]\r
39             });\r
40         }\r
41         win.show(this);\r
42     });\r
43 });