Context menus
Instead of handling clicks yourself, you can let us render a context menu at the mouse cursor and populate it with actions.
There is one method per click type. Implement the ones you need and return the actions to show:
protected function getDateClickContextMenuActions(): array
{
return [
$this->createFooAction(),
$this->createBarAction(),
];
}
protected function getDateSelectContextMenuActions(): array
{
return [
$this->createFooAction(),
];
}
protected function getEventClickContextMenuActions(): array
{
return [
$this->viewAction(),
$this->editAction(),
$this->deleteAction(),
];
}
protected function getNoEventsClickContextMenuActions(): array
{
return [
$this->createFooAction(),
];
}
The corresponding interaction has to be enabled for the menu to show up, for example dateClickEnabled for the date click menu. Please read clicks and selections for the individual flags.
on* handler.Troubleshooting
If your context menu actions mount the wrong thing, make sure the name of each action is unique across the whole widget. If there is another action with the same name, it might be mounted instead of the one you want.