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, for exampleDayPilot.Eventfor an event bubble; read-onlyargs.async(boolean) - set totrueto activate asynchronous loadingargs.html(string) - the bubble content to be displayedargs.loaded()- call this method when asynchronous loading is active to indicate thatargs.htmlhas been setargs.div(HTMLElement) - the main bubble<div>element; available since 2025.4.6774; read-only
Notes
For asynchronous loading, set args.async = true, assign the content to args.html, and call args.loaded() when the content is ready.
Example
Synchronous loading:
const bubble = new DayPilot.Bubble({
onLoad: (args) => {
const ev = args.source;
args.html = "testing bubble for: " + ev.text();
}
});Asynchronous loading:
const bubble = new DayPilot.Bubble({
onLoad: (args) => {
const ev = args.source;
args.async = true; // notify manually using .loaded()
// simulating slow server-side load
setTimeout(() => {
args.html = "testing bubble for: <br>" + ev.text();
args.loaded();
}, 500);
}
});See Also
Bubble [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot