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 thestop
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);
}
精彩评论