Event click handling

Events
DayPilotCalendar can handle both single- and double-click events:
- EventClick
- EventDoubleClick
- EventRightClick
Handling mode
You can set the handling mode by changing EventClickHandling or EventDoubleClickHandling properties. Available modes:
- Disabled (default value)
- JavaScript (runs custom code on the client side)
- PostBack (runs the server-side event handler using PostBack)
- CallBack (runs the server-side event handler using CallBack)
- Edit (enters inline edit mode)
- Select (selects the event, fires EventSelect event depending on EventSelectHandling value)
- Bubble (shows a bubble for this event, see also Extended ToolTips (bubbles))
JavaScript handling gives you the greatest flexibility. You can execute your own client-side code and than execute CallBack or PostBack.
Example:
<DayPilot:DayPilotCalendar runat="server"
EventClickHandling="JavaScript"
EventClickJavaScript="eventClick(e)"
ClientObjectName="dpc"
DataTagFields="status"
...
/>
Client-side handler:
function eventClick(e) {
// only fire the server-side event if the ID is 5 or status field is set to tentative
if (e.value() == "5" || e.tag("status") == "tentative") {
dpc.eventClickCallBack(e);
}
}
Double clicks
Double clicks are detected automatically: no EventClick event will be fired if the second click happens within 300 ms:
- You can use both EventClick and EventDoubleClick event handlers at the same time.
- Each of these events can perform a different action, e.g. inline editing on double click, opening event bubble on single click.