setEvent

adds a new event to the scheduler's data pool

void setEvent(string| number id,object event);
idstring| numberthe event's id
eventobjectthe 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.
See also
Back to top