Context menu - varies depending on the event

I’m using onContextMenu as per the sample, but it is static for all events. How can I vary the context menu depending on the event clicked.

i.e. I might want some elements disabled or even not displayed at all if an event matches a certain criteria.


The menu is usually shown from onContextMenu event of a scheduler, where event id is available.
You can inspect the active event and rebuild the menu appropriately before calling .showContextMenu method: