1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
| 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 with title <em>after</em> tools',
| header: {
| titlePosition: 2,
| titleAlign: 'center'
| },
| closable: true,
| closeAction: 'hide',
| width: 600,
| minWidth: 350,
| height: 350,
| tools: [{type: 'pin'}],
| layout: {
| type: 'border',
| padding: 5
| },
| items: [{
| region: 'west',
| title: 'Navigation',
| width: 200,
| split: true,
| collapsible: true,
| floatable: false
| }, {
| region: 'center',
| xtype: 'tabpanel',
| items: [{
| // LTR even when example is RTL so that the code can be read
| rtl: false,
| title: 'Bogus Tab',
| html: '<p>Window configured with:</p><pre style="margin-left:20px"><code>header: {\n titlePosition: 2,\n titleAlign: "center"\n},\ntools: [{type: "pin"}],\nclosable: true</code></pre>'
| }, {
| 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;
| });
| }
| });
| });
|
|