Robin
Robin

Reputation: 21894

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, 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.

Upvotes: 3

Views: 8411

Answers (1)

FMM
FMM

Reputation: 4329

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.

Upvotes: 2

Related Questions