1. To show a hover popup, you can use the Bubble component. For time headers, it is necessary to use an active area that will display a custom bubble when the action is set to “Bubble”.
This example will insert a transparent active area that covers the whole header cells and invokes the specified bubble on hover. You can also replace it with a smaller area that displays an icon.
The time header cell details are available as args.source
in the onLoad
handler of the bubble.
onBeforeTimeHeaderRender: args => {
args.header.areas = [
{
top: 0,
bottom: 0,
left: 0,
right: 0,
action: "Bubble",
bubble: new DayPilot.Bubble({
onLoad: args => {
const header = args.source;
args.html = "your rich content";
}
}
}
];
}
2. Instead of a hover bubble, you can use the onClick
handler of the active area to display a modal dialog. You can use DayPilot.Modal or any other third party modal dialog.
onBeforeTimeHeaderRender: args => {
args.header.areas = [
{
top: 0,
right: 0,
height: 20,
width: 20,
fontColor: "black",
symbol: "daypilot.svg#edit", // or any other icon
onClick: args => {
const header = args.source;
// display your modal dialog
}
}
];
}