Search
Calendar.headerClick Event
See Also
 






Raised when a calendar header is clicked.

Namespace: MindFusion.Scheduling
File: Calendar.js

 Syntax

JavaScript  Copy Code

EventDispatcher headerClick

 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 HeaderEventArgs 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 headerClick event of a calendar. In the handler method we check if type of the header clicked was the timeline and if yes, we change the calendar view to timetable.

JavaScript  Copy Code

var p = MindFusion.Scheduling;

// attach a handler - when a calendar header is clicked
calendar.headerClick.addEventListener(handleHeaderClick);

function handleHeaderClick(sender, args) {
    //the args.type argument gives information about the type of header that was clicked
    if(args.type == p.HeaderType.Timeline)
      {
        //change the calendar view to timetable
        calendar.currentView = p.CalendarView.Timetable;
           
      }
}

 See Also