I have a scenario where I need to toggle an Event context menu item (Cancel / Activate) so that the context menu only shows the appropriate option for the event.
- Active Events need to display the Cancel Item and Hide (not disable) the Activate Item
- Cancelled Events need to display the Activate Item and Hide (not disable) the Cancel Item
I am looking for an action similar to below that will allow be to set the visibility of the item to false. I am unable to find anything in the documentation that describes this. (I am aware "show = false" is not a valid option). I would also rather not use multiple context menus as there are 7 other items in the menu.
if (e.data.tags.isCancelled) {
args.menu.items[context.CancelShift].show = false;
} else {
args.menu.items[context.ActivateShift].show = false;
}
Currently Using DayPilot Pro for JavaScript 2019.1.3572
Thanks!