Sortable: How to delete item by drag?

Created on 22 Dec 2014  路  5Comments  路  Source: SortableJS/Sortable

I have a special area, where when I drag there ghost, I remove it, so there's no more draggable item. It was on 0.5.2, but now after update I get "Uncaught TypeError: undefined is not a function" in _dispatchEvent, line rootEl.dispatchEvent(evt); because there' no rootEl.
So - is there a safe way to delete an item by drag, especially on touch devices?
Thanks in advance

question

Most helpful comment

Nice example. I took a slightly different approach where items are deleted on dragging items outside the sortable list.

Here's the working code I ended up with:
http://jsbin.com/yajigagali/1/edit?html,css,js,output

All 5 comments

Correctly will be as follows: http://jsbin.com/petimu/1/edit?html,css,js,output

thank you very much

Nice example. I took a slightly different approach where items are deleted on dragging items outside the sortable list.

Here's the working code I ended up with:
http://jsbin.com/yajigagali/1/edit?html,css,js,output

@oniisaki Very nice work.

Was this page helpful?
0 / 5 - 0 ratings