0
我有一个表的一堆项目,我创建了一个函数来删除一行,但想用模式来确认用户实际上想删除一个行。查询有一个函数等待,直到用户点击是或取消
我删除功能如下:
var removeFootable_row = function() {
var $this, $currentFooTable, $currentTable, $currentRow;
$this = $(this);
$currentFooTable = $this.parents("table").data("footable");
$currentTable = $this.parents("table");
$currentRow = $this.parents("tr");
$("#confirm-modal").modal("show");
// I WANT TO PAUSE HERE AND ONLY CONTINUE IF THE USER CLICKS THE YES BUTTON
$currentRow.animate({opacity:0},{
duration:150,
queue:false,
complete:function() {
setTimeout(function() {
$currentFooTable.removeRow($currentRow);
}, 250);
}
});
};
我读了一些关于承诺和延期,但我真的不知道该怎么办的最好的方法是这样的,任何想法?提前感谢您的帮助。
将点击事件处理程序绑定到“是”按钮并将“animate”调用放在那里。 – 2014-09-12 19:02:42
什么插件实现'模态'? – 2014-09-12 19:03:03
我使用引导模式 – loriensleafs 2014-09-12 19:05:27