Search
Calendar.formShow Event
See Also
 






Raised when a popup form is shown.

Namespace: MindFusion.Scheduling
File: Calendar.js

 Syntax

JavaScript  Copy Code

EventDispatcher formShow

 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 formShow event of a calendar. In the handler method we check if the title of the form that is shown is "New Appointment". If it is, we do not allow the form to appear.

JavaScript  Copy Code

// attach a handler - a calendar popup form gets displayed
calendar.formShow.addEventListener(handleFormShow);

function handleFormShow(sender, args) {
    //the args.form argument is of type BaseForm
    if(args.form.headerText = "New Appointment")
      {
        //do not allow new events to be created
        args.cancel = true;
           
      }
}

 See Also