The events.add()
method adds a new event to the JavaScript Scheduler component and renders it. Multiple subsequent calls when adding several events will be merged into a single UI update automatically.
DayPilot.Scheduler.events.add(e, data);
e (DayPilot.Event) - event to be created (it can be either a DayPilot.Event object or a raw data object)
data (object) - custom data to be sent to the server side with the Notify event (ASP.NET WebForms, ASP.NET MVC, Java)
DayPilot.Action object that stores the action details.
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 Notify Event Model (DayPilot Pro for ASP.NET WebForms)