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

Remove Item from page when dropped into a Sortable

2 Answers 219 Views
Sortable
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 06 Oct 2014, 10:49 PM
I am trying to implement a screen with Three sortables (left pane, right pane, remove pane). When the user drags an item to the remove sortable I want to remove it from that sortable. (they are deleting it basically)

I have tried e.item.remove in the change event handler, but that just makes the dragged element show on the screen as well as the new item in the sortable. 

I have tried to prevent the drop to the new sortable using e.item.PreventDefault and also e.draggableObject.item.preventDefault and then just remove it from the original sortable, but I can't seem to prevent the change.

Any suggestions on how to do this?

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 08 Oct 2014, 04:46 PM
Hello Bob,

Basically you should simply remove the HTML element at the change event handler. I am not sure why this approach does not work in your scenario.
Could you please check this example and let me know what I am missing?

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bob
Top achievements
Rank 1
answered on 09 Oct 2014, 07:52 PM
Hmm... I tried it again and it worked perfectly. I have no idea what I was doing wrong before. 

Thanks for the sample.
Tags
Sortable
Asked by
Bob
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Bob
Top achievements
Rank 1
Share this question
or