JavaScript

The JavaScript version uses api2 by default.

Possible handling types (eventClickHandling):

  • 'Enabled' (default)
  • 'Disabled'
  • 'Edit'
  • 'Select'
  • 'ContextMenu'
  • 'Bubble'

API

Examples

Define a custom action for Ctrl+click:

dp.onEventClick = function(args) {
  if (args.ctrl) {
    dp.multiselect.add(args.e);   // add to selection 
    args.preventDefault();        // cancel the default action
  }
};

Simple alert box:

dp.onEventClicked = function(args) {
  alert("clicked: " + args.e.id());
};

ASP.NET WebForms

You can assign an action to event click using EventClickHandling property.

  • 'Disabled' (default)
  • 'PostBack'
  • 'CallBack'
  • 'JavaScript'
  • 'Edit'
  • 'Select'
  • 'ContextMenu'
  • 'Bubble'
<DayPilot:DayPilotScheduler 
  ID="DayPilotScheduler1" 
  runat="server" 
  EventClickHandling="JavaScript"
  EventClickJavaScript="eventClick(e);"
  ...
  />

ASP.NET MVC

You can assign an action to event click using EventClickHandling property.

  • 'Disabled' (default)
  • 'CallBack'
  • 'JavaScript'
  • 'Edit'
  • 'Select'
  • 'ContextMenu'
  • 'Bubble'
@Html.DayPilotScheduler("dps", new DayPilotSchedulerConfig {
  BackendUrl = ResolveUrl("~/Scheduler/Backend"),
  EventClickHandling = EventClickHandlingType.JavaScript,
  EventClickJavaScript = "editEvent(e.value());",
  ...
})