Hello guys,
I want to right click on event in scheduler to show tooltip (intead hover on it) like this.
Or custom :event-menu-feature to show a template HTML.
Can you help me, please!
The easiest way I see here is to catch https://bryntum.com/docs/gantt/api/Gantt/feature/TaskMenu#event-taskMenuBeforeShow and return false for cases when you want to see that custom tooltip instead of menu.
That handler has taskElement
you can use for positioning your popup/tooltip. Here is docs how to show tooltip https://bryntum.com/docs/gantt/api/Core/widget/Tooltip
All the best,
Alex
So multiple things.
If you do not want a context menu, disable that feature. Then reconfigure the eventTooltip feature to do as you want:
features : {
eventMenu : false,
eventTooltip : {
forSelector : false,
showOnHover : false
}
},
listeners : {
eventContextMenu({ event, eventElement }) {
event.preventDefault();
// Call the tooltip's "over" handler on the context menu event
scheduler.features.eventTooltip.tooltip.handleForElementOver(event, eventElement)
}
}
That will get it showing on context menu.
Then you can add your template to change what it shows. I believe there are examples of how to do that.
FYI, the configuration of the Feature is passed into the configuration of its tooltip, so you just need
features : {
eventTooltip : {
forSelector : false,
allowOver : true,
scrollAction : 'hide',
template : async({}) => { ... }
}
}
newInstance
is only for the tooltip config on Widgets. This always gets its own instance.