我正在使用它,它在浏览器上运行得很好
http://docs.jquery.com/UI/Sortable
现在我想将其保存到服务器,我了解serialize
,但我不想更新所有内容。
在服务器上我只想知道什么被移动到哪里。
是否可以在 stop
事件中找到这一点?又如何?
提前致谢。
最佳答案
一种解决方案是将您的 stop
函数设置为:
stop: function(e,ui) {
var allItems = $(this).sortable("toArray");
var newSortValue = allItems.indexOf( $(ui.item).attr("id") );
alert($(ui.item).attr("id") + " was moved to index " + newSortValue);
}
关于jQuery UI 可排序 - 将更改保存到服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3234665/