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

How to remove default mousedown event on calendar events? - II

Asked by RichieRich
5 years ago.

In continuation to this (https://forums.daypilot.org/Topic.aspx/4356/how-to-remove-default-mousedown-event-on-calendar-events) question, check uploaded image.

I tried what you suggested but still the 'drag-start' event is not fired unless I remove 'mousedown' event from 'div.calendar_default_event'. [Tried by removing 'mousedown' event manually in inspect element window for div.calendar_default_event, dragstart was fired].

In Image:
Div 'dndDroapableWorkshift' is inside the 'Event', which has another div inside it'Tile' which will be dragged. Hightlighted dragstart event is on 'Tile', which only gets fired when I remove 'mousedown' from highlighted div.calendar_default_event.
I tried adding mousedown to 'Tile' , it gets fired properly but after mousedown 'dragstart' is not fired.

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

Thanks for the update.

In that case you can use onAfterEventRender to remove the mousedown event handler. It's defined using onmousedown property so you can simply set it to null:

onAfterEventRender: args => {
  args.div.onmousedown = null;
}

Let me know if it didn't help.

Comment posted by RichieRich
5 years ago.

Thank you so much!
It worked.

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