views:

59

answers:

1

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 moved to where.
Is it possible to find that out on the stop event? And how?

Thanks in advance.

A: 

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);
}
Simen Echholt