- // tabs for the center
- var tabs = new Ext.TabPanel({
- region: 'center',
- margins:'3 3 3 0',
- activeTab: 0,
- defaults:{autoScroll:true},
-
- items:[{
- title: 'Bogus Tab',
- html: Ext.example.bogusMarkup
- },{
- title: 'Another Tab',
- html: Ext.example.bogusMarkup
- },{
- title: 'Closable Tab',
- html: Ext.example.bogusMarkup,
- closable:true
- }]
- });
-
- // Panel for the west
- var nav = new Ext.Panel({
- title: 'Navigation',
- region: 'west',
- split: true,
- width: 200,
- collapsible: true,
- margins:'3 0 3 3',
- cmargins:'3 3 3 3'
- });
-
- var win = new Ext.Window({
- title: 'Layout Window',
- closable:true,
- width:600,
- height:350,
- //border:false,
- plain:true,
- layout: 'border',
-
- items: [nav, tabs]
- });
-
- win.show(this);
+ if (!win) {
+ win = Ext.create('widget.window', {
+ title: 'Layout Window',
+ closable: true,
+ closeAction: 'hide',
+ //animateTarget: this,
+ width: 600,
+ height: 350,
+ layout: 'border',
+ bodyStyle: 'padding: 5px;',
+ items: [{
+ region: 'west',
+ title: 'Navigation',
+ width: 200,
+ split: true,
+ collapsible: true,
+ floatable: false
+ }, {
+ region: 'center',
+ xtype: 'tabpanel',
+ items: [{
+ title: 'Bogus Tab',
+ html: 'Hello world 1'
+ }, {
+ title: 'Another Tab',
+ html: 'Hello world 2'
+ }, {
+ title: 'Closable Tab',
+ html: 'Hello world 3',
+ closable: true
+ }]
+ }]
+ });
+ }
+ button.dom.disabled = true;
+ if (win.isVisible()) {
+ win.hide(this, function() {
+ button.dom.disabled = false;
+ });
+ } else {
+ win.show(this, function() {
+ button.dom.disabled = false;
+ });
+ }