I found an Error in the documentation for panel dropdowns
In section “Listen for dropdown event” it has to be:
$dropdown[] = [
'icon' => 'share',
'text' => 'Publish on Netlify',
'click' => [
/* 'key' => 'myEvent' - does not work */
'global' => 'myEvent', /* changed from 'true' to event name */
'payload' => [...]
]
];
I have checked the https://github.com/getkirby/kirby/blob/main/panel/src/components/Dropdowns/DropdownContent.vue in Order to find the problem, because the this.$events.on("myEvent", (payload) => {...}); did not fire, until i changed the code like above and now the event is triggered in my js-script.