-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo_menubar.js
96 lines (87 loc) · 2.55 KB
/
demo_menubar.js
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Ext.ux.menu.MenuBar demo application.
*
* Copyright (c) 2012 Alexander Tokarev.
*
* This code is licensed under the terms of the Open Source LGPL 3.0 license.
* Commercial use is permitted to the extent that the code/component(s) do NOT
* become part of another Open Source or Commercially licensed development library
* or toolkit without explicit permission.
*
* License details: http://www.gnu.org/licenses/lgpl.html
*/
Ext.Loader.setConfig({
enabled: true,
disableCaching: true,
paths: {
'Ext.ux': 'ux'
}
});
Ext.require([
'Ext.panel.Panel',
'Ext.ux.menu.MenuBar',
'Ext.window.MessageBox'
]);
var panel, menu;
Ext.onReady(function() {
Ext.tip.QuickTipManager.init();
var onClick = function(menuItem) {
Ext.Msg.show({
title: 'Click!',
msg: 'You clicked item "' + menuItem.text + '"',
icon: Ext.Msg.INFO,
buttons: Ext.Msg.OK
});
};
panel = new Ext.panel.Panel({
renderTo: Ext.getBody(),
width: 400,
height: 200,
tbar: {
xtype: 'menubar',
items: [{
text: 'Foo menu',
menu: {
plain: true,
items: [{
icon: false,
text: 'Item 1',
handler: onClick
}, {
icon: false,
text: 'Item 2',
handler: onClick
},
'-',
{
icon: false,
text: 'Item 3 (submenu)',
menu: {
plain: true,
items: [{
icon: false,
text: 'Submenu item',
handler: onClick
}]
},
handler: onClick
}]
}
}, {
text: 'Bar menu',
menu: {
plain: true,
items: [{
icon: false,
text: 'Item 1',
handler: onClick
}, {
icon: false,
text: 'Item 2',
handler: onClick
}]
}
}]
}
});
});