Cancel dragging an element if some checkings were not passed


How can i cancel dragging and move draggable event to it’s initial place, if some checkings were not passed?

For example, this case:

scheduler.attachEvent("onDragEnd", function(id, mode, e) {
if ( /* some condition, for example, if event's start_date after dragging is in stop-array or 
anything else. And i am sure that condition is working!*/ ) {
console.log("Event moving error");
return false;

So i expect that “return false” will abort this dragging and the element will be placed again on it’s initial place. For example, this “return false;” works nice in “onEventSave” - it aborts the saving. What can i do in my case?


Haha, it was very easy. Just to use “onBeforeEventChanged” instead of “onDragEnd”