Nov 24, 2009, 12:48 PM
[CLOSED] Adding Sub-Menus Dynamically to SplitButton in GridPanel Command Column
Hi,
I'm building a menu dynamically in a grid using the prepareToolbar command.
I would like to add sub-menu items.
How can I get a handle on a dynamically created menu item?
For example, in my menu below, I would like to add a submenu under the menu titled 'Operations Review'.
My function is as so:
I'm building a menu dynamically in a grid using the prepareToolbar command.
I would like to add sub-menu items.
How can I get a handle on a dynamically created menu item?
For example, in my menu below, I would like to add a submenu under the menu titled 'Operations Review'.
My function is as so:
function PrepareInfo(toolbar, soeId, id, taskname,name) {
var rolesButton = toolbar.items.get(0); //get the menu
rolesButton.menu = new Ext.menu.Menu({});
rolesButton.setText('Actions');
var templateUrl = 'FundPage.aspx?id={0}&tab=6';
rolesButton.menu.addMenuItem({
text: 'Investment Review',
url: String.format(templateUrl, id),
icon: 'CooliteResources/Icons/application_start.png',
handler: function(item) {
window.parent.location.href = item.url;
}
});
var templateUrl = 'FundPage.aspx?id={0}&tab=3';
rolesButton.menu.addMenuItem({
text: 'Operations Review',
url: String.format(templateUrl, id),
icon: 'CooliteResources/Icons/application_start.png',
handler: function(item) {
window.parent.location.href = item.url;
}
});
}