Handling Events with Mobile Scheduler

Attaching Event Handler

The user can add any user-defined handler to any of the available events. To do this, the user can apply the attachEvent method with the following parameters:

  • evName - name of the event;
  • evHandler - user-defined event handler.
$$("scheduler").attachEvent(evName, evHandler);

Several handlers can be attached to one and the same event, and all of them will be executed. The names of the events are case-insensitive.

Detaching Event Handler

There is a simple way of removing an event-handler:

$$("scheduler").detachEvent(id); // unique id of the event handler

Add, Delete and Update Event Handling

To handle CRUD operations you can set the onAfterAdd, onAfterDelete and onStoreUpdated event handlers for Scheduler data store. You can get data store by the "data" property of Scheduler.


fires after an event has been added into scheduler

    var eventObj = this.getItem(itemId);
    // your code here
  • itemId - {string} the id of the newly added event


fires after an event has been deleted

    // your code here
    return true;
  • itemId - {string} the id of the deleted event


fires when the data store has been updated

    if(operation == "update"){
       // your code here
    return true;
  • itemId - {string} the id of the event object
  • item - {object} the event object
  • operation - {string} type of the operation

Handling event choosing


To process the behavior of the component on choosing an event, you can use the onBeforeEventShow event.

This event is fired by Scheduler when an event is chosen in one of the calendar lists. If this event returns false, a form with event details won't be shown:

   // your code
   return true;
Back to top