X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/window/layout.js diff --git a/examples/window/layout.js b/examples/window/layout.js index 7c1d6613..6edc70ab 100644 --- a/examples/window/layout.js +++ b/examples/window/layout.js @@ -1,61 +1,58 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ +Ext.require([ + 'Ext.tab.*', + 'Ext.window.*', + 'Ext.tip.*', + 'Ext.layout.container.Border' +]); Ext.onReady(function(){ - - Ext.state.Manager.setProvider( - new Ext.state.SessionProvider({state: Ext.appState})); - - var button = Ext.get('show-btn'); + var win, + button = Ext.get('show-btn'); button.on('click', function(){ - // 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; + }); + } }); }); \ No newline at end of file