Skip to main content

setEvent

Description

Adds a new event to the scheduler's data pool

setEvent: (id: string|number, event: any) => void

Parameters

  • id - (required) string | number - the event's id
  • event - (required) object - the event object

Example

scheduler.setEvent(1, {
start_date: new Date(2013, 05, 16, 09, 00),
end_date: new Date(2013, 05, 16, 12, 00),
text: "Meeting",
holder: "John",
room: "5"
});
scheduler.setCurrentView();

Details

The method is similar to addEvent.

The difference between the setEvent() and addEvent() methods is:

  • The addEvent draws the event in the scheduler and invokes the onEventAdded / onEventChanged events that can trigger updating data in the original data source (e.g. database).
  • The setEvent() method doesn't invoke any events and just adds an event to the data pool. To draw the event in the scheduler you should call the setCurrentView method additionally.
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.