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

Undo Moving event and Undo Resizing event

Asked by Maheswar
6 years ago.

I would like to confirm the user after moving an event or re sizing an event,but i don't want to load from server.
Here is my codec

dp.onEventMoved = function (args) {
if (confirm('Are you sure you want to edit this?')) {
//Continue Http Request
}
else
{
//stopping Http Request
}
};

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

Use .onEventMove event handler instead and call args.preventDefault() to prevent the default action and onEventMoved event from being processed:

dp.onEventMove = function(args) {
  if (!confirm('Are you sure you want to edit this?')) { 
    args.preventDefault();
  } 
};

dp.onEventMoved = function (args) { 
  //Continue Http Request 
};

See also:
http://api.daypilot.org/daypilot-scheduler-oneventmove/
http://api.daypilot.org/daypilot-scheduler-oneventmoved/

Comment posted by Maheswar Reddy
6 years ago.

No .. It is not working.

Comment posted by Dan Letecky [DayPilot]
6 years ago.

You can find a working example for the scheduler here:

http://javascript.daypilot.org/sandbox/scheduler/eventmoving.html

Instead of submitting the change to the server using an AJAX call it simply displays a message but the logic is the same.

Let me know if there is any problem.

Comment posted by Maheswar Reddy
6 years ago.

Thank you so much it was working ..it is my mistake (typing)
instead of "move" i used "moved".

Comment posted by Anonymous
6 years ago.

Is there a way that we can use a modal for the user to choose some options from instead of a confirm() function? I can not find a way to stop the event from continuing with the modal like the confirm dialog does...

I would very much appreciate an example of this! thank you!

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