Confirm drag and drop

We would like to make it so that when you drag an event it displays an alert that says “Confirm Event Change” and if selecting no it doesn’t move the event.

Thank you!!!

Robert

Any joy on this one?

You can use onBeforeEventChanged event

scheduler.attachEvent("onBeforeEventChanged", function (event_obj, native_event, is_new){ do_something(); return true; });

scheduler.attachEvent(“onBeforeEventChanged”, function (event_obj, native_event, is_new){
do_something();
return true;
});

I have placed confirm message but its not working.

Have you got a function called: do_something(); ?

Be sure that you are using scheduler 2.2, older versions don’t have such event.

After implementing this it only partly works. On even creation the conformation is also being executed.

Also if we cancel the drag and drop in the multi-resourse view, after dragging to another resource, it is not returning the event back to the original resource but to the original time of the resource that it was drug too.

Thank you in advanced for all the help!!!

Third parameter of handler - is_new - flag which can be used to define separate logic for changed and newly created events.

original resource but to the original time of the resource that it was drug too.

Yep, original logic works only with date of event, it doesn’t preserve any other properties of event. You can use some custom code to store original unit value in onBeforeDrag event and restore it in the onBeforeEventChanged

We will give that a try.

Thank you for all your help!!

Robert