onContextMenuItemClick
Description
Fires when a built-in or custom context menu item is selected
onContextMenuItemClick: (id: string | number, item: UIMenuItem, context: IContextMenuEventContext) => void | boolean
Parameters
id- the selected item's IDitem- the selected item descriptorcontext- the context the menu was opened with
Example
gantt.attachEvent("onContextMenuItemClick", function (id, item, context) {
if (id === "delete" && context.task?.protected) return false;
return true;
});
Details
Requires the context menu plugin. The event fires for custom and built-in items. Return false to cancel a built-in action.
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.