search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

custom bubble/context menu for different event types

Asked by Vincent
3 months ago.

Would the best approach to accommodate for different bubbles/context menus for different event types(like maybe a low priority event vs a high priority event having their own respective bubbles/context menu) be to use the onBeforeEventRender to designate which bubble or context menu to use for each event?

Or should this be handled in the scheduler’s .bubble event?

Answer posted by Dan Letecky [DayPilot]
3 months ago.

There are two options:

1. You can use onBeforeEventRender to assing a custom bubble HTML to each event:

{
  onBeforeEventRender: args => {
    args.data.bubbleHtml = `my bubble HTML`;
  },
  // ...
}

2. You can also use the onLoad event of the bubble to generate the bubble content dynamically, depending on the source event. You can access the source DayPilot.Event object as args.source there:

{
  bubble: new DayPilot.Bubble({
    onLoad: args => {
      const e = args.source;
      args.html = `my bubble HTML`;
    }
  },
  // ...
}
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.