/ext-4.0.7/examples/toolbar/toolbar-menu-overflow.js
JavaScript | 40 lines | 25 code | 1 blank | 14 comment | 1 complexity | 89311da76293a0c81a4d121cef17f49d MD5 | raw file
1/*
2
3This file is part of Ext JS 4
4
5Copyright (c) 2011 Sencha Inc
6
7Contact: http://www.sencha.com/contact
8
9GNU General Public License Usage
10This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14*/
15Ext.require(['*']);
16var buttons = [{
17 xtype: 'tbtext',
18 text : 'Text'
19}, {
20 xtype: 'tbseparator'
21}];
22for (var i = 0; i < 20; i++) {
23 buttons.push({
24 text: 'Button ' + (i + 1),
25 handler: function(b) {
26 Ext.Msg.alert('Click', 'You clicked ' + b.text);
27 }
28 })
29}
30
31Ext.onReady(function() {
32 Ext.create('Ext.toolbar.Toolbar', {
33 renderTo: Ext.getBody(),
34 width : 600,
35 layout: {
36 overflowHandler: 'Menu'
37 },
38 items: buttons
39 });
40});