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

daypilot remove event using javascript event listener

Asked by Anonymous
4 years ago.

how to remove the event created when clicked on the "x"?

[1st pic]

this is my code on creating the event

[2nd pic]

i tried this one, but as expected, it doesn't work.

$(document).on('click', '.event_action_delete', function(e){;

please, help me with this. thank you!

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

The events.remove() method requires DayPilot.Event object. This is the recommended way to add a custom icon with an onclick event handler (using an active area):

<div id="dp"></div>
<script type="text/javascript">
  var dp = new DayPilot.Scheduler("dp");
  dp.onBeforeEventRender = function(args) {
    args.e.areas = [
        top: 3,
        right: 2
        bottom: 9,
        width: 17,
        onClick: function(args) {; },
        visibility: "Hover",
        css: "event_action_delete"
  // ...

See also:


Comment posted by Anonymous
4 years ago.

it does not work :(

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