DayPilot.Bubble.onLoad

The onLoad event handler is called when the bubble is activated, before the bubble is displayed. You can use it to generate the content dynamically.

Declaration

DayPilot.Bubble.onLoad(args)

Parameters

  • args.source (object) - the source object (e.g. DayPilot.Event for event bubble); read-only

  • args.async (boolean) - set to true to activate asynchronous loading

  • args.html (string) - the bubble content to be displayed

  • args.loaded() - call this method when asynchronous loading is active to indicate that args.html has been set

Example (sync)

dp.bubble = new DayPilot.Bubble({
    onLoad: function(args) {
        var ev = args.source;
        args.html = "testing bubble for: " + ev.text();
    }
});

Example (async)

dp.bubble = new DayPilot.Bubble({
    onLoad: function(args) {
        var ev = args.source;
        args.async = true;  // notify manually using .loaded()
        
        // simulating slow server-side load
        setTimeout(function() {
            args.html = "testing bubble for: <br>" + ev.text();
            args.loaded();
        }, 500);
    }
});