Search
Calendar.itemDeleting Event
See Also
 






Raised while an item is being deleted.

Namespace: MindFusion.Scheduling
File: Calendar.js

 Syntax

JavaScript  Copy Code

EventDispatcher itemDeleting

 Event Data

The event handler method receives the following arguments:
sender
A Calendar instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
An ItemModifyingEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

 Example

The following example attaches a handler to the itemDeleting event of a calendar. In the handler method we check if the subject of the item that the user tries to delete is "Math". If yes, we cancel the action.

JavaScript  Copy Code

var p = MindFusion.Scheduling;

// attach a handler - when a calendar item is being deleted
calendar.itemDeleting.addEventListener(handleItemDeleting);

function handleItemDeleting(sender, args) {
    //the args.item argument gives information about the item that is being deleted
     if(args.item.subject == "Math")
          args.cancel = true;
     
}

 See Also