In the code below the update function gets called twice when an item is moved from list sortable1
to sortable2
. Though I need to call that function only once:
$("#sortable1 tbody, #sortable2 tbody").sortable({
connectWith: '.connectedSortable tbody',
helper: fixHelper,
handle : '.handle',
update : function () {
var order = $('#sortable1 tbody').sortable('serialize');
}
}).disableSelection();
Answer from: http://forum.jquery.com/topic/sortables-update-callback-and-connectwith
update: function(e,ui) {
if (this === ui.item.parent()[0]) {
//your code here
}
}