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