Cancel drop

Hi,

I've a dual list box, but, sometimes, when I drop a item I need cancel this drop.

On drop function, DragEventArgs can not have a property for cancel.

How can I cancel a drop?

Thanks

3 Replies 1 reply marked as answer

GK Gayathri KarunaiAnandam Syncfusion Team February 15, 2021 12:20 PM UTC

Hi Manolo, 

Thank you for contacting Syncfusion support. 

We have checked your reported query. We can cancel the drop event by using args.cancel property in beforeDrop event as demonstrated in the below code snippet   
HTML 
<ejs-listbox 
        #listbox1 
        [dataSource]="dataA" 
        [allowDragAndDrop]="true" 
        height="330px" 
        scope="combined-list" 
        [fields]="fields" 
        (drop)="onDropGroupA($event)" 
        (beforeDrop)="dragging($event)" 
      ></ejs-listbox> 

TS 
public dragging(args: DragEventArgs): void { 
    args.cancel = true; 
  } 

For your reference, we have prepared a sample based on your requirement. Please check the below link. 


Please check the above link and get back to us, if you need further assistance. 

Regards, 
Gayathri K 


Marked as answer

MC Manolo Capdevila February 15, 2021 03:38 PM UTC

Thanks


GK Gayathri KarunaiAnandam Syncfusion Team February 16, 2021 05:00 AM UTC

Hi Manolo, 

Thanks for the update. 

We are happy to hear that your requirement has been fulfilled. Please feel free to contact us if you need any further assistance on this. 

Regards, 
Gayathri K 


Loader.
Up arrow icon