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

DayPilot.Scheduler.onEventMoved - no way to check for original even dates

Asked by Leo
23 hours ago.

Hi Dan,

on the DayPilot.Scheduler.onEventMoved, onEventMove, onEventResized, and potentiall others, there is no official way to retrieve the event’s original start and end. I see there is an undocumented args.e.orig as well as args.e.cache, which both carry the previous values.

Would it be possible to “officially” expose args.e.orig and add it to TypeScript?

It’s really handy for specific checks before sending off the request to the backend.

Cheers
Leo

Answer posted by Dan Letecky [DayPilot]
16 hours ago.

Hi Leo,

For this purpose, there are two events for each action, e.g. onEventMove and onEventMoved.

In onEventMove, the args.e object is the original DayPilot.Event object and the new position is available as args.newStart, args.newEnd and args.newResource.

The same applies to other event handlers as well.

Comment posted by Leo
16 hours ago.

Hi Dan,

Thanks for your answer.

We already use all the events available. But basically, in onEventMoved and onEventResized, we determine if there are actual changes to the dates (and resource) before sending requests to the API. We also check whether it’s a move of more than a day or not.

We can’t push that logic to the onEventMove - hence the question if the args.e.orig could be documented, as it’s exactly what’s needed and available anyways.

Cheers
Leo

Comment posted by Dan Letecky [DayPilot]
15 hours ago.

I understand. But the orig property is internal state. There is no clear contract that guarantees the behavior. Now I see that it will have to be removed so you don’t start to rely on it.

However, the args object is the same and the args.e object is also the same between onEventMove and onEventMoved. So I recommend trying them for storing the original location or other flags as temp values.

If you need a property of args in TypeScript for passing data between onEventMove and onEventMoved, that should be no problem.

Comment posted by Leo
15 hours ago.

Ah, if the args are shared between those events that’s perfect. Thank you.

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):