The events.add() method adds a new event to the JavaScript Scheduler component and renders it.
Multiple subsequent calls when adding several events are merged into a single UI update automatically.
DayPilot.Scheduler.events.add(e[, data])e (DayPilot.Event | DayPilot.Event.data) - event to be created; you can pass either a DayPilot.Event instance or a raw event data object
data (object) - custom data to be sent to the server side with the Notify event (ASP.NET WebForms, ASP.NET MVC, Java)
Returns a DayPilot.Action object that stores the action details.
You can use either a DayPilot.Event object or a raw DayPilot.Event.data object when creating the event.
When you provide the optional data parameter, it is sent to the server with the Notify event in ASP.NET WebForms, ASP.NET MVC, and Java versions.
Create a new event using a DayPilot.Event object:
const e = new DayPilot.Event({
start: new DayPilot.Date(),
end: new DayPilot.Date().addHours(5),
id: DayPilot.guid(),
text: "New Event",
resource: "E"
});
dp.events.add(e);Create a new event using a raw data object:
dp.events.add({
start: new DayPilot.Date(),
end: new DayPilot.Date().addHours(5),
id: DayPilot.guid(),
text: "New Event",
resource: "E"
});DayPilot.Scheduler.events.find()
Client-Side Event API [doc.daypilot.org]
Event Loading [doc.daypilot.org]