There are two ways to do it:
1. Store the old event start and end in the args object in onEventResize (which is fired before the default action). The same object will be passed to onEventResized. Then use the old values to revert the operation if needed.
dp.onEventResize = function(args) {
args.original ={
start: args.e.start(),
end: args.e.end()
};
};
dp.onEventResized = function(args) {
$.post("/update", function(result) {
if (result.rollback) { // your object returned by the server
args.e.start(args.original.start);
args.e.end(args.original.end);
dp.events.update(args.e);
}
});
};
2. Do it the other way around - postpone the update until it's confirmed by the server. Call the server from onEventResize instead of onEventResized and cancel the default action using args.preventDefault().
dp.onEventResize = function(args) {
args.preventDefault();
$.post("/update", function(result) {
if (result.commit) { // your object returned by the server
args.e.start(args.newStart);
args.e.end(args.newEnd);
dp.events.update(args.e);
}
};