Search
Calendar.formClose Event
See Also
 






Raised when a popup form is closed.

Namespace: MindFusion.Scheduling
File: Calendar.js

 Syntax

JavaScript  Copy Code

EventDispatcher formClose

 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 FormEventArgs 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 formClose event of a calendar. In the handler method we check if the title of the form that is closed is "Choose a Date". If it is, we do not allow the form to be closed.

JavaScript  Copy Code

// attach a handler - closing of a calendar popup form
calendar.formClose.addEventListener(handleFormClose);

function handleFormClose(sender, args) {
    //the args.form argument is of type BaseForm
    if(args.form.headerText = "Choose a Date")
      {
        //do not allow the form to be closed without a date being set
        args.cancel = true;
           
      }
}

 See Also