Search
Calendar.selectionChanged Event
See Also
 






Raised when a selection changes.

Namespace: MindFusion.Scheduling
File: Calendar.js

 Syntax

JavaScript  Copy Code

EventDispatcher selectionChanged

 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
A SelectionEventArgs 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 selectionChanged event of a calendar. In the handler method we check if the start time of the selection is after the 10th day of the month. If yes, we cancel the selection.

JavaScript  Copy Code

var p = MindFusion.Scheduling;

// attach a handler - when the calendar selection has changed.
calendar.selectionChanged.addEventListener(handleSelectionChanged);

function handleSelectionChanged(sender, args) {
    /* the args.startTime argument gives information about
     * the start of this selection */
     if(args.startTime.day > 10)
          {
              args.cancel = true;
          }
     
}

 See Also