【发布时间】:2015-07-23 16:41:50
【问题描述】:
我使用stop 回调设置了可排序并绑定esc 以取消当前排序。在stop回调中,如何判断当前排序是取消还是完成?
这是我目前的 sn-p:
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
}
}
});
【问题讨论】:
标签: jquery jquery-ui jquery-ui-sortable