views:

51

answers:

2

I have two lists connected with jQuery UI's sortable, allowing to drag items from one list to another.

http://jsbin.com/uraga3

Is there a simple way to drag several items at the same time - e.g. to move items #3, #4 and #7 from left to right?

+1  A: 

Not in the plugin.

You can write some custom code to add items to a selection and then move multiple at once.

Like:

$( "li" ).bind( "click", function() {
  $(this).toggleClass('sorting-selected');
});

$( "ul" ).bind( "sortreceive", function(event, ui) {
  $('li.sorting-selected').appendTo($(this));
});
Mark
Thanks, this is very useful, and I like the simplicity of it. I might look into adding a helper clone for visual feedback, perhaps based on fudgey's post.I wish I could accept both your answers - will choose one once I've figured out my final solution.
AnC
+1  A: 

I answered a similar question here (demo)

fudgey
Thanks, this will need some digging for me to fully understand, but it looks very useful. As mentioned in my response to Mark, I'm in a bit of a conundrum regarding which answer to pick...
AnC
I've spent some time digging into your code and experimenting with it. Unfortunately, it appears the `drag` event (or an equivalent) is not available when using `sortable`!?
AnC