Drag behaviour

Hello, 

I have one question about draging events. 

If I click on event, it changes and is ready for drag, everything is ok here. How can I cancel drag If I start this process accidentally - click on event, drag "mode" activated, but I want to abort drag action. 

KR,
Ivan

3 Replies 1 reply marked as answer

NR Nevitha Ravi Syncfusion Team October 22, 2020 06:44 AM UTC

Hi Ivan, 

Greetings from Syncfusion Support. 

We can prevent the drag action based on your condition using dragStart event, please refer the following sample. 


  dragStart: function(args) { 
    args.cancel = true; 
  } 

Please get back to us for further assistance. 

Regards, 
Nevitha  



IV Ivan October 22, 2020 07:35 AM UTC

You didn't understand me. 

I want drag functionality, but I want cancel option if user start this process without intention. So, event is set for 09:00 and user accidentally start moving event and want to cancel this action. So everything stays same as before, without trigering update event on server. 

On desktop is pretty easy to start drag event, if you click and at same time moving, even slowly, mouse You are about start draw event. On Mobile device, you need to tap some time to switch to drag mode. 


VD Vinitha Devi Murugan Syncfusion Team October 23, 2020 12:48 PM UTC

Hi Ivan, 
 
Thanks for your update. 
 
We suspect that your requirement is to prevent the drag action when drop the event on same time and same can be achieved by making using the dragStop event of our scheduler. Please refer below codes and same can be available in below sample.  
 
  dragStop: function(args) { 
    if (args.data.StartTime.getTime() - this.getEventDetails(args.element).StartTime.getTime() ===0) { 
      args.cancel = true; 
      console.log('Drag prevented'); 
    } 
  } 
 
 
 
 
Regards, 
Vinitha 


Marked as answer
Loader.
Up arrow icon