nativesortable icon indicating copy to clipboard operation
nativesortable copied to clipboard

added support for multiple sortable lists.

Open kmturley opened this issue 12 years ago • 2 comments

Nice plugin, thought it would make sense to allow dragging between multiple native sortables on the same page. Changed so it always save the current drag item to a variable that all sortables can check themselves against. Then if the draggable's parent is different the item is cloned into to the new list and sorted accordingly

kmturley avatar May 06 '12 12:05 kmturley

Sweet! A couple things:

  • I noticed that it doesn't remove the class="sortable-dragging sortable-child" on the new list (just running through the demo)
  • Mind modifying the demo to show this in action? Maybe something like this: http://jqueryui.com/demos/sortable/#connect-lists.

I also wonder if we should make it an option, like the connectWith option on jQuery UI Sortable. Thoughts?

bgrins avatar May 07 '12 13:05 bgrins

I know that this is an old PR, but still idea is really cool, my comment below.

  1. Usage of this global variable is terrible - I think that by using something like connectWith we could avoid it.
  2. Classes are not being removed only when moving items between lists - this is because the element in onDragEnd event here. We are adding an item which was not there before and it is not being refreshed. Proper way to handle it would be to delegate events to a different container element or to refresh the element provided while initialising nativesortable.

I will maybe put some time to figure this out as I need this plugin for my project.

bx2 avatar Aug 24 '13 16:08 bx2