Hiya,
I am trying to validate event drag usecase in timeline view. Use case: If the event is dragged to an invalid slot (for example in past) then an error message is shown to the user and event is reset to its original position.
The problem is: if event is dragged to some slot (that is in the past) in a different row then the event’s position is not reset to original but the next available position in that row. If event is dragged to an invalid slot in the same row then everything is working fine and event is reset to its original position.
Here is my code sample handling this stuff:
scheduler.attachEvent("onBeforeEventChanged", function(event, native_event, is_new){
return blocker(event);
});
var blocker = function(ev){
var res;
if(ev.start_date<new Date()){
alert("Cannot move in the back date");
res=false;
}else{
alert("Test updated to start at: "+ev.start_date);
res=true;
}
if (!res) {
scheduler._drag_id = null;
scheduler._drag_mode = null;
scheduler.callEvent("onLimitViolation",[ev.id, ev]);
}
return res;
};
Any pointers/help will be highlt appreciated.
Thanks,
Rehan