Reputation: 375
I am using this script to drag and drop. It make clone of block to drop block. In block 1 there is multi select list. when 1 drop multi select list to block 2 it does not work.
$('#sa_drag_block li').draggable({
helper: "clone",
});
$('#sa_drop_block').droppable({
drop: function (e, ui) {
$(ui.draggable).clone().appendTo($(this));
}
});
Here is JSFiddle Link
Upvotes: 0
Views: 704
Reputation: 41691
There were a few things working against you here, but I was able to make it work
So you can fix these two issues for pretty much any JavaScript plugin by following a cycle when either initially dragging or dropping the elements
destroy
methods, select2('destroy')
in this case.You can find the working, commented jsfiddle here: http://fiddle.jshell.net/uffhvenk/6/
Upvotes: 1
Reputation: 1289
Clone does not copy event handlers and data by default. Try clone(true)
.
Upvotes: 0