-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu-example.html
More file actions
executable file
·189 lines (168 loc) · 4.76 KB
/
menu-example.html
File metadata and controls
executable file
·189 lines (168 loc) · 4.76 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<html>
<head>
<title>Stores</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="icons/icons.css" />
<style>
body{
background-color:#aeaeae;
}
#container{
background-color:#ccc;
}
</style>
<script src="extjs/adapter/ext/ext-base.js"></script>
<script src="extjs/ext-all-debug.js"></script>
<script>
Ext.BLANK_IMAGE_URL = 'extjs/resources/images/default/s.gif';
var genericHandler = function(menuItem, eventObj) {
Ext.MessageBox.alert('', 'Your choice is ' + menuItem.text);
}
// default xtype for Menu is going to be "menuitem"
var menuItems = [
{
text : 'Add Item',
handler : genericHandler
},
{
text : 'Search',
handler : genericHandler
},
/* You also have two special menus... Color and Date
{
text : 'Choose Color',
iconCls : 'icon-color_swatch',
menu : {
xtype : 'colormenu',
colors : ['FF0000', '00FF00', '0000FF'],
handler : function(picker, choice) {
Ext.MessageBox.alert('', 'Your choice is ' + choice);
}
}
},
var dateMenuItem = {
text : 'Choose Date',
iconCls : 'icon-calendar',
menu :{
xtype : 'datemenu',
handler : function(picker, choice) {
Ext.MessageBox.alert('', 'Your choice is ' + choice);
}
}
}, // */
"-", // special Separator
{
text: 'New Department',
iconCls: 'icon-group_add',
menu: [
{
text: 'Management',
iconCls: 'icon-user_green',
handler: genericHandler
},
{
text: 'Accounting',
iconCls: 'icon-user_brown',
handler: genericHandler
}
]
}
];
var menu = new Ext.menu.Menu({
items : menuItems,
listeners : {
beforehide : function() {
// this just disables the event, preventing the menu from hiding
return false;
}
}
});
Ext.onReady(function () {
//menu.showAt([100, 100]);
// buttons
/*
new Ext.Button({
renderTo : Ext.getBody(),
text : 'Plain Button',
iconCls : 'icon-control_power',
handler : function (btn) {
btn.el.frame();
}
});
// */
new Ext.ButtonGroup({
renderTo : Ext.getBody(),
title: 'Manage Emails',
items: [
{
text: 'Pase as',
iconCls: 'icon-clipboard',
menu: [
{
text: 'Plain Text',
iconCls: 'icon-paste_plain'
},
{
text: 'Word',
iconCls: 'icon-paste_word'
}
]
},
{
text: 'Copy',
iconCls: 'icon-page_white_copy'
},
{
text: 'Cut',
iconCls: 'icon-cut'
},
{
text: 'Clear',
iconCls: 'icon-erase'
}
]
});
// Toolbar
/*
new Ext.Window({
width: 500,
height: 200,
tbar: {
// default xtype for toolbar items is "button"
items: [
{
text: 'Add',
iconCls: 'icon-add'
},
'-',
{
text: 'Update',
iconCls: 'icon-update'
},
'-',
{
text: 'Delete',
iconCls: 'icon-delete'
},
'->',
'Select one of these:',
{
xtype : 'combo',
width : 100,
store :[
'Monday',
'Tuesday',
'Wednesday'
]
}
]
}
}).show();
// */
});
</script>
</head>
<body>
<div id="container"></div>
</body>
</html>