博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
swal() 弹出删除确认框
阅读量:7237 次
发布时间:2019-06-29

本文共 800 字,大约阅读时间需要 2 分钟。

//删除

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 

关闭确认 

转载于:https://www.cnblogs.com/oyw911/p/10094917.html

你可能感兴趣的文章
ThinkPHP 3.2.3 数据缓存与静态缓存
查看>>
2-7-集合运算(A-B)∪(B-A)-线性表-第2章-《数据结构》课本源码-严蔚敏吴伟民版
查看>>
Linux中设置服务自启动的三种方式
查看>>
友盟新功能介绍:在线参数-备用
查看>>
RAC object remastering ( Dynamic remastering )
查看>>
Log4net使用(一)
查看>>
[Android][Android Studio] *.jar 与 *.aar 的生成与*.aar导入项目方法
查看>>
PopUpWindow使用详解(二)——进阶及答疑
查看>>
史上最完整的Android开发工具集合
查看>>
Pythonn new-style class and old-style class
查看>>
Java中对象构造
查看>>
Linq一对多联合查询
查看>>
CYQ.Data 从入门到放弃ORM系列:开篇:自动化框架编程思维
查看>>
在设计DJANGO用户更改密码时,出现NoReverseMatch at /account/password-change/这种妖精如何办?...
查看>>
android中保存一个ArrayList到SharedPreferences的方法
查看>>
NOIP模拟赛20161016R1
查看>>
SQL Server 常用命令
查看>>
ElasticSearch插件安装Head、Kopf与Bigdesk
查看>>
安卓开发必备知识体系:安卓篇
查看>>
python列表推导式详解 列表推导式详解 字典推导式 详解 集合推导式详解 嵌套列表推导式详解...
查看>>