2010-07-13 28 views

回答

2

一個解決辦法是你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); 
}