ASPxClientGanttContextMenuItem Class
A context menu item.
Declaration
declare class ASPxClientGanttContextMenuItem
Remarks
The ASPxGantt allows you to customize the built-in (ContextMenuCustomization) or create a custom context menu (ContextMenu).
The built-in context menu supports predefined and custom items. Use the CustomCommand event to handle clicks on custom items. You can call the Clear method to remove predefined items from the context menu.
<dx:ASPxGantt ID="Gantt" ClientInstanceName="clientGantt" >
//...
<ClientSideEvents
ContextMenuCustomization="function(s, e) {
...
// Creates an item
var customItem = new ASPxClientGanttContextMenuItem();
customItem.name = 'Item1';
customItem.text = 'Item1';
customItem.beginGroup = true;
// Adds the item to the context menu items
e.menuItems.Add(customItem);
// Creates a subitem
var customSubItem = new ASPxClientGanttContextMenuItem();
customSubItem.name = 'Subitem1';
customSubItem.text = 'Subitem1';
// Adds the subitem to the parent item.
customItem.GetSubItems().Add(customSubItem);
...
}
CustomCommand="function(s, e) {
// Handles an item click
if(e.commandName == 'Item1') {
// your code
}
}
/>
</dx:ASPxGantt>
Examples
Online Demo
See Also