This is a migrated thread and some comments may be shown as answers.

ListView undo drag and drop

1 Answer 87 Views
Sortable
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 31 Oct 2019, 01:21 PM

In the attached below, I don't want an Empty to be dragged to another Empty.   But anything else is allowed.

Is there an undo event?

Thanks

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 04 Nov 2019, 07:57 AM

Hi Peter,

The Kendo UI Sortable widget exposes the End event. It can be prevented. What I can suggest is that you subscribe to this event and in case the value of the item is 0 or empty call the preventDefault() method.

.Events(ev=>ev.End("onEnd"))

function onEnd(e){
    if(condition){
        e.preventDefault();
     }
}

The item could be accessed via the e.item argument. More information could be found here:

https://docs.telerik.com/aspnet-mvc/api//Kendo.Mvc.UI.Fluent/SortableEventBuilder#endsystemfuncsystemobjectsystemobject

In case further assistance is required, let me know.

 

Best regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Sortable
Asked by
Peter
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or