This code assumes the server returns a valid response (any server-side error will be returned using .error property in the response JSON). You can extend it easily for other types of server-side failure by adding .fail() handler to the $.ajax() call.
Note the key parts:
* Switch to async handling using args.async = true
* Cancel the action using args.preventDefault();
* Confirm the action using args.loaded();
Comment posted by Christos Georgiou 10 years ago.
Alright.. this seems to work but now I have another problem.
I have set blockOnCallBack = true
and my onEventMove = function(args) {
args.async = true;
if (!confirm('Are you sure you want to edit this?')) {
args.preventDefault();
args.loaded();
return;
}
// some code
}
The problem is that the ui is blocked even if I click on "cancel" on confirm box, like the args.loaded() not working properly
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.