Disable horizontal drag muliday unit view

Hi ,
is it possible to disable the horizontal drag in multiday unit view in creation mode , for example if drag in section a and move the mouse to another section like c , i want the event to stay in its original section , i hope my question is clear.
docs.dhtmlx.com/scheduler/sample … _days.html

thank you :smiley:

It’s possible to enable or disable drag, the onBeforeDrag event:

scheduler.attachEvent('onBeforeDrag', function(id){
   var ev = scheduler.getEvent(id);
    console.log(ev);
    if (something) 
        return true; // allow drag
   else
       return false;  // prevent drag         
})

And then prevent drop in:

scheduler.attachEvent("onBeforeEventChanged", function(event_object, native_event, is_new){
    return false;
 });

hi bmcgin and thanks for your help ,

sadly it’s not what i’m looking for , what i want is while creating the event is to disable the event dragging from a section to another in multi day unit view like in here
docs.dhtmlx.com/scheduler/sample … _days.html

if you try to create a new event and move the mouse horizontally the event will change the section.
what i’m looking for is a way to make the event stick to it’s original section (the first section where i dragged).
i hope you get what im trying to do.

thank you very much.

hi , i solved the problem using this post viewtopic.php?f=25&t=38850&p=121431&hilit=drag#p121431 and adapt it to my needs
if any one is looking for a solution here is what i did
var old_section = scheduler._update_unit_section;
scheduler._update_unit_section = function(){
if(scheduler.getState().drag_mode != ‘new-size’){
return old_section.apply(this, arguments);
}
};

thanks.