jQuery Sortable: helper option
I have 2 sortable lists, let's say "modules" and "available-modules"
$(".available-modules").sortable({
// helper: 'clone'
// or
helper: function(e, elt) {
return elt.clone(true);
}
})
None of this work: when I drop an item from "available-modules" to "modules", the item from "available-modules" is removed. I thought that using helper: clone
would just insert the clone,开发者_如何学Python not the actual item.
Is this my responsability to reinsert the element in the "available-modules" list after inserting it in the other one or is there a problem with my helper
option?
Thanks.
It seems like you need something a bit like this demo:
http://jqueryui.com/demos/draggable/#sortable
The drag "source" isn't sortable, just draggable, and makes use of the connectToSortable
option.
精彩评论