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
| Ext.require(['*']);
|
| function doTest () {
| var buttons = [{
| xtype: 'tbtext',
| text : 'Text'
| }, {
| xtype: 'tbseparator'
| }];
|
| for (var i = 0; i++ < 20; ) {
| buttons.push({
| text: 'Button ' + i,
| id: 'button' + i,
| handler: function(b) {
| Ext.Msg.alert('Click', 'You clicked ' + b.text);
| }
| })
| }
|
| Ext.create('Ext.toolbar.Toolbar', {
| renderTo: Ext.getBody(),
| width : 600,
| layout: {
| overflowHandler: 'Menu'
| },
| items: buttons
| });
| }
|
| Ext.onReady(doTest);
|
|