【发布时间】:2012-07-24 20:31:36
【问题描述】:
我正在使用 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();
});
}
});
【问题讨论】:
-
那么您到底在寻找什么?它的工作,对吧?
-
现在它只发送一个具有新排序顺序的数组(即 1,2,3,4,5)。它需要发送一个关联数组来显示正在排序的项目及其新的父 UL。
标签: php jquery jquery-ui-sortable