[VUE 2] How can i custom right click on event to show tooltip
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!
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
Thank you, but i want to show a template of HTML in menu (event-menu-feature Scheduler) (only show info, it is not a menu) like
But i can custom html in processItems, here is menu and my code:
I found eventMenuBeforeShow but it not working. Please help me! Thanks
Or How can i turn on my tooltip by right click on a Job in Scheduler?
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.
Thank you, but can you show me the eventTooltip.tooltip config?
Please help me.
It is the same config, so i call:
schedulerConfig.features.eventTooltip.handleForElementOver
or schedulerConfig.features.eventTooltip.tooltip.handleForElementOver
I still get: Uncaught TypeError: schedulerConfig.features.eventTooltip.tooltip.handleForElementOver is not a function
My version: 4.0.8
Thank you, i resolve this problem.
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.