3
我設置了stop
回調排序和綁定esc
取消當前排序。在stop
回調中,如何判斷當前的排序是否已取消或完成?Jquery-UI Sortable:如何判斷在停止回調中排序是否被取消?
這是我目前的片段:
this.$("tbody").sortable({
start: function() {
shortcut.add("esc", function() {
that.$("tbody").sortable("cancel");
});
},
handle: ".sortable-handle",
stop: function(e, ui) {
shortcut.remove("esc");
// how to check if cancel was called during sorting?
if (!e.canceled) {
// save new state
}
}
});