/ext-4.1.0_b3/docs/extjs/examples/window/layout.js
https://bitbucket.org/srogerf/javascript · JavaScript · 60 lines · 58 code · 2 blank · 0 comment · 3 complexity · 0ec9b28eee477e0df509d4d9a06859e3 MD5 · raw file
- Ext.require([
- 'Ext.tab.*',
- 'Ext.window.*',
- 'Ext.tip.*',
- 'Ext.layout.container.Border'
- ]);
- Ext.onReady(function(){
- var win,
- button = Ext.get('show-btn');
- button.on('click', function(){
- if (!win) {
- win = Ext.create('widget.window', {
- title: 'Layout Window',
- closable: true,
- closeAction: 'hide',
- width: 600,
- minWidth: 350,
- height: 350,
- layout: {
- type: 'border',
- padding: 5
- },
- 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;
- });
- }
- });
- });