Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / desktop / TabWindow.js
1 /*!
2  * Ext JS Library 4.0
3  * Copyright(c) 2006-2011 Sencha Inc.
4  * licensing@sencha.com
5  * http://www.sencha.com/license
6  */
7
8 Ext.define('MyDesktop.TabWindow', {
9     extend: 'Ext.ux.desktop.Module',
10
11     requires: [
12         'Ext.tab.Panel'
13     ],
14
15     id:'tab-win',
16
17     init : function(){
18         this.launcher = {
19             text: 'Tab Window',
20             iconCls:'tabs',
21             handler : this.createWindow,
22             scope: this
23         }
24     },
25
26     createWindow : function(){
27         var desktop = this.app.getDesktop();
28         var win = desktop.getWindow('tab-win');
29         if(!win){
30             win = desktop.createWindow({
31                 id: 'tab-win',
32                 title:'Tab Window',
33                 width:740,
34                 height:480,
35                 iconCls: 'tabs',
36                 animCollapse:false,
37                 border:false,
38                 constrainHeader:true,
39
40                 layout: 'fit',
41                 items: [
42                     {
43                         xtype: 'tabpanel',
44                         activeTab:0,
45                         bodyStyle: 'padding: 5px;',
46
47                         items: [{
48                             title: 'Tab Text 1',
49                             header:false,
50                             html : '<p>Something useful would be in here.</p>',
51                             border:false
52                         },{
53                             title: 'Tab Text 2',
54                             header:false,
55                             html : '<p>Something useful would be in here.</p>',
56                             border:false
57                         },{
58                             title: 'Tab Text 3',
59                             header:false,
60                             html : '<p>Something useful would be in here.</p>',
61                             border:false
62                         },{
63                             title: 'Tab Text 4',
64                             header:false,
65                             html : '<p>Something useful would be in here.</p>',
66                             border:false
67                         }]
68                     }
69                 ]
70             });
71         }
72         win.show();
73         return win;
74     }
75 });