Our pure JavaScript Scheduler component


Post by hammadch360 »

Hello. In my Application, We are assigning new event to each resource. And I want to add custom EventTooltip to an event on saving the event. Here is my code

/** On Before Event Saved */
    onBeforeEventSave(e: any): void {
        e.eventRecord.eventTooltip = {
            align : 'l-r',
            template: (data: any) => `<p>Holiday DX</p>`
        };
        e.eventRecord.eventColor = 'red';
    }

Can you tell me how i can achieve this...


Post by alex.l »

eventRecord doesn't have eventTooltip property.
You need to set required logic into EventTooltip feature config
https://bryntum.com/docs/scheduler/api/Scheduler/feature/EventTooltip#config-template

A function which receives data about the event and returns a string, or a Promise yielding a string (for async tooltips), to be displayed in the tooltip.

https://bryntum.com/docs/scheduler/api/Scheduler/feature/EventTooltip

template has hovered record in params. Use that to create a tooltip you need.

All the best,
Alex


Post Reply