The events.add() method adds a new item to the Queue, appends it to DayPilot.Queue.events.list, and displays it immediately.
Declaration
DayPilot.Queue.events.add(e)Parameters
e(DayPilot.Event or raw object) - event to be created
The raw object structure is defined in DayPilot.Event.data.
Notes
When you pass a raw object instead of a DayPilot.Event instance, it should follow the DayPilot.Event.data structure.
Example
Create a new event:
const event = new DayPilot.Event({
id: 1,
text: "New Event",
duration: 120
});
dp.events.add(event);See Also
DayPilot.Queue.events.update()
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot