I had this working in UI 1.8.6 using this hack, but I cant seem to get it to work in 1.8.17.
- I want to drag items from a list into a sortable.
- The items should remain in the source list after dropping (so they can be added n times)
- when i drop the item into the sortable, i want to get a handle on the instance of the dropped item in the sortable.
In the receive method of the sortable:
receive: function(e, ui){
// ui.item is the original dragged item, not the clone that gets created when dropped
// ui.helper is a separate clone of the dragged item, it does not get inserted into the sortable
}
so the question is, how do I get a handle on the inserted item? It seems the item hasn’t been inserted (or created) by the time receive is called. Has a change been made to jquery UI or am I missing something?
here’s my code:
$('form').sortable({
placeholder: "placeholder",
forcePlaceholderSize: true,
receive: function (ev, ui) {
// need handle on dropped item here. ui.item and ui.helper are not it
}
});
$('.draggableTings').draggable({
helper: "clone"
, appendTo: "body"
, revert: "invalid"
, connectToSortable: "form"
});
Thanks
replacing this
with this
seems to have done the trick, nasty though. and probably not fool proof