How can I get a new cloned item in jQuery Sortable sort function

I drag the new item into the sorted list, but when I call ui.item, it points to the original object. How can I get a link to a new fallen object?

Link to the same issue on the jQuery forum:

http://forum.jquery.com/topic/sortable-receive-how-do-i-get-new-item

+3
source share
2 answers

You can use update instead of getting to get the handle of the newly dropped object.

, . , ( ).

+2

jQuery UI 1.10 :

$('#sortable-list').sortable({
  receive: function (event, ui) {
    // New item
    var droppedItem = $(this).data().uiSortable.currentItem;
  }
});
0

All Articles