I posted a question previously See Here and nearly have a solution that I would like to post.
I have managed to get this working by using the following:
$(".todoList").sortable({
update: function (event, ui) {
if (this === ui.item.parent()[0]) {
var numLists = $("ul.menu").length;
for (var i = 1; i <= numLists; i++) {
$.post("updateDB.php", {
pages: $("#menu-pages" + i).sortable('toArray'),
listid: i
});
}
}
},
connectWith: ".connectedSortable"
});
However, with this solution it will query the DB x amount of times if I have x amount of lists. Before I post the answer, I want to know if it would be possible to create a 2D array of the arrays for each 'i' and only $.post once.
Thanks in advance.