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
| /**
| * @example Lazy Instantiation
| *
| * A basic example demonstrating how a Container contains other items using the items config.
| */
| Ext.require('Ext.tab.Panel');
| Ext.require('Ext.window.MessageBox');
|
| Ext.onReady(function() {
|
| Ext.create('Ext.tab.Panel', {
| renderTo: Ext.getBody(),
| height: 100,
| width: 200,
| items: [
| {
| // Explicitly define the xtype of this Component configuration.
| // This tells the Container (the tab panel in this case)
| // to instantiate a Ext.panel.Panel when it deems necessary
| xtype: 'panel',
| title: 'Tab One',
| html: 'The first tab',
| listeners: {
| render: function() {
| Ext.MessageBox.alert('Rendered One', 'Tab One was rendered.');
| }
| }
| },
| {
| // this component configuration does not have an xtype since 'panel' is the default
| // xtype for all Component configurations in a Container
| title: 'Tab Two',
| html: 'The second tab',
| listeners: {
| render: function() {
| Ext.MessageBox.alert('Rendered One', 'Tab Two was rendered.');
| }
| }
| }
| ]
| });
| });
|
|