我正在使用 jQuery UIs Sortable 来允许用户从 4 列中移动项目以及更改每列中项目的顺序。我让后者工作没有问题;将新订单更新到数据库。
但我不确定如何处理从 A 列到 B 列的存储移动。每个无序列表都有一个唯一的 ID,所以我想将这些信息一起发送;我只是不知道如何做到这一点。
$("#list1, #list2, #list3, #list4").sortable({
connectWith: ".sort",
placeholder: "shadow",
dropOnEmpty: true,
opacity: 0.8,
cursor: 'move',
update: function() {
var order = $(this).sortable("serialize") + '&update=update';
$.post("/update.php", order, function(theResponse) {
$("#alert").html(theResponse);
$("#alert").slideDown('slow');
slideout();
});
}
});