Search
Events

Almost every element in the Calendar has certain events which can trigger JavaScript functions. For example, when an item is created by a user action, the itemCreated event will be raised. When the item is modified, the itemModified event is raised and here is how you handle it:

JavaScript  Copy Code

// handle itemModified event to repaint the calendars when an item is modified interactively
calendar.itemModified.addEventListener(repaint);
calendar2.itemModified.addEventListener(repaint);

function repaint(sender)
{
 // trigger full repaint on the calendar control not sending the event in order to recreate all of its item visuals
 if (sender == calendar)
  calendar2.repaint(true);
 else
  calendar.repaint(true);
}

This code handles the itemModified event on two calendars and repaints the one that has triggered the event.

MindFusion.Scheduling for JavaScript provides two types of events:

The "Handling Events" tutorial provides you with a step-by-step practical guide on how to consume events.