Christos,
Take a look at the "Asynchronous Validation" demo:
http://javascript.daypilot.org/demo/scheduler/asyncvalidation.html
dp.onEventMove = function(args) {
args.async = true;
dp.message("Checking....");
$.ajax({
url: "asyncvalidation.txt",
method: "GET",
data: {
dateFrom: args.newStart.toString(),
dateTo: args.newEnd.toString(),
id: args.e.id()
}
}).done(function (response) {
var $response = $.parseJSON(response);
if ($response.error) {
dp.message($response.message);
args.preventDefault();
}
args.loaded();
});
};
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();