开发者

jQuery UI sortable - Saving changes to server

I am using this and it's working perfectly on the browser

http://docs.jquery.com/UI/Sortable

Now I want to save it to the server, I know about serialize, but I don't want to update everything.

On the server I only want to know what was mo开发者_开发知识库ved to where.

Is it possible to find that out on the stop event? And how?

Thanks in advance.


One solution would be to set your stop function to this:

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);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜