Page 1 of 1

[VUE 2] How can i custom right click on event to show tooltip

Posted: Wed Oct 13, 2021 5:08 am
by sactory

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!


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Wed Oct 13, 2021 8:12 am
by alex.l

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


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Wed Oct 13, 2021 9:36 am
by sactory

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

Screen Shot 2021-10-13 at 14.21.33.png
Screen Shot 2021-10-13 at 14.21.33.png (152.18 KiB) Viewed 1194 times

But i can custom html in processItems, here is menu and my code:

Screen Shot 2021-10-13 at 14.22.19.png
Screen Shot 2021-10-13 at 14.22.19.png (27.81 KiB) Viewed 1194 times
Screen Shot 2021-10-13 at 14.22.41.png
Screen Shot 2021-10-13 at 14.22.41.png (141.85 KiB) Viewed 1194 times

I found eventMenuBeforeShow but it not working. Please help me! Thanks


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Wed Oct 13, 2021 10:30 am
by sactory

Or How can i turn on my tooltip by right click on a Job in Scheduler?


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Wed Oct 13, 2021 3:40 pm
by Animal

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.


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Thu Oct 14, 2021 4:20 am
by sactory

Thank you, but can you show me the eventTooltip.tooltip config?
Please help me.


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Thu Oct 14, 2021 5:06 am
by sactory

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


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Thu Oct 14, 2021 9:28 am
by sactory

Thank you, i resolve this problem.


Re: [VUE 2] How can i custom right click on event to show tooltip

Posted: Fri Oct 15, 2021 10:14 am
by Animal

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.