首页 > 其他 > 详细

swal() 弹出删除确认框

时间:2018-12-10 10:10:52      阅读:830      评论:0      收藏:0      [点我收藏+]

//删除
function del() {

var id = "";
var row = $.map($("#DataList").bootstrapTable(‘getSelections‘), function (row) {
id = row.Id;
return row;
});
if (row == null || row.length <= 0) {
swal("提示信息", "请选择要删除的记录!", IconMsg.WARNING);
return false;
}
swal({
title: "确定删除选中的记录?",
text: "删除之后无法恢复该数据!",
type: IconMsg.WARNING,
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "确定",
closeOnConfirm: false
},
function () {
$.ajax({
type: ‘post‘,
url: ‘/Users/DelUserById‘,
dataType: "json",
data: { id: id },
success: function (data) {
if (data.Result) {
$("#DataList").bootstrapTable(‘refresh‘);
swal("提示信息", data.Msg, data.IconMsg);
} else {
swal("提示信息", data.Msg, data.IconMsg);
}
}
});

});

前台页面上显示:

技术分享图片

closeOnConfirm: false / true 

关闭确认 

swal() 弹出删除确认框

原文:https://www.cnblogs.com/oyw911/p/10094917.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!