DHTMLX Docs & Samples Explorer

Event Handling

attaching/detaching events

You can attach several handlers to the same event and detach them using two respective methods:

  1. attachEvent() - to attach event

    var myEvent = myCalendar.attachEvent("onClick", function(){
        // event handler code
    });
  2. detachEvent() - to detach event

    myCalendar.detachEvent(myEvent);

list of events

  • onBeforeChange - fires before the user starts to change month, year or time in the selector
  • onClick - fires after the user selects a date
  • onChange - fires when the user changes month, year or time in the selector
  • onShow - fires when the calendar becomes visible (useful when attached to an input)
  • onHide - fires when the calendar becomes hidden (useful when attached to an input)
  • onMouseOver - fires when the user moves the mouse cursor over the specified date
  • onMouseOut - fires when the user moves the mouse cursor out from the specified date
  • onPopupShow - fires when popup becomes visible (user move mouse over cell with tooltip)
  • onPopupHide - fires when popup becomes hidden (user move mouse out from cell with tooltip)