search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to process event double click without error in DayPilot Calendar?

Asked by B
8 years ago.

Hi,

I currently have a DayPilot Calendar with no double clicking capabilities enabled. For some reason, when an event is clicked twice, I receive the following error:

Unhandled exception at line 14, column 34823...
...JavaScript runtime error: Unable to get property 'length' of undefined or null reference

I would like to use a handler for the double click event, but can't find any documentation regarding this matter in the DayPilot Calendar API. Could anyone tell me which properties need to be set up for this?

Thanks in advance!

Answer posted by Dan Letecky [DayPilot]
8 years ago.

Please see the documentation on how to use event double click event:

http://doc.daypilot.org/calendar/event-double-click/

In the latest realease (http://javascript.daypilot.org/daypilot-pro-for-javascript-8-0-sp2/) you just need to add the event handler:

<div id="dp"></div>

<script type="text/javascript">
  var dp = new DayPilot.Scheduler("dp");
  dp.onEventDoubleClick = function(args) {
    alert("Event with id " + args.e.id() + " was double-clicked");
  };
</script>

In the next release (builds 1746+) , event double click will be disabled by default and it will be necessary to turn it on:

<div id="dp"></div>

<script type="text/javascript">
  var dp = new DayPilot.Scheduler("dp");
  dp.eventDoubleClickHandling = "Enabled";
  dp.onEventDoubleClick = function(args) {
    alert("Event with id " + args.e.id() + " was double-clicked");
  };
</script>

Please let me know if the error above happens with the latest sandbox build:

http://javascript.daypilot.org/sandbox/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.