I am trying to put together the following with jQuery and Sortable: There are two cases that I need to grab:
I am also looking for same... but all above solutions not working as I want. From jquery-ui connected sortable list get serialize/toarray values of two list if item moved from one to another.
Finally I figure it out with single method which is update.
function getSortableOrder(sortableList,ui){
var listItems = {}
listItems['sortable'] = sortableList.sortable('toArray');
if(ui.sender!=null)
listItems['sender'] = ui.sender.sortable('toArray');
console.log(listItems);
}
$('.sortable[sortable="true"]').sortable({
connectWith:".sortable",
placeholder: "ui-state-highlight",
update: function(ev, ui) {
getSortableOrder($(this),ui);
}
});
- item 1
- item 2
- item 3
- item 4
- item 5
- item 6