layui中table表格的操作列(删除,编辑)等按钮的操作
暂停和中止按钮功能
if (obj.event === 'del') {
layer.confirm('确认中止么', function (index) {
$.ajax({
type: "post",
url: "/flow/processIntance/delete.afca",
data: {
"processInstanceId": data.processInstanceId,
"deleteReason": inputValue
},
dataType: 'json',
success: function (data) { if (data.code === '0') {
// obj.del();
layer.close(index);
layer.msg(data.msg, {icon: 1, time: 2000, shade: 0.1});
console.log(table);
reload();
} else {
layer.close(index);
layer.alert(data.msg, {
icon: 2, title: '提示'
});
return;
}
},
error: function () {
}
})
});
} else if (obj.event === 'start-process' || obj.event === 'stop-process') {
var text = (data.suspended) ? "继续" : "暂停";
layer.confirm('确认' + text + '当前流程吗', function (index) {
$.ajax({
type: "post",
url: "/flow/isSuspended.afca",
data: {
"processInstanceId": data.processInstanceId,
"type": data.suspended ? 'start' : 'stop'
},
dataType: 'json',
success: function (data) { if (data.code === '0') {
// obj.del();
layer.close(index);
layer.msg(data.msg, {icon: 1, time: 2000, shade: 0.1});
reload();
} else {
layer.close(index);
layer.alert(data.msg, {
icon: 2, title: '提示'
});
return;
}
},
error: function () {
}
})
});
}
//编辑,删除,发布申请
table.on('tool(demo)', function(obj){
var data = obj.data;
// console.log(data)
if(obj.event === 'check'){
// console.log(data.id);
$('.textCon').val("");
layer.open({
title: '发布申请'
,type: 1
,maxmin:true
,area: ['700px','570px']
,content: $('#toExamine')
,btn: ['申请', '取消']
,yes: function(index, layero) {
var userName = $('#userRadio').val();
if(userName == null || userName == ''){
layer.msg("请选择用户", {icon: 2, time: 2000});
return;
}
var describe = $('.textCon').val();
if(describe == null || describe == ''){
layer.msg("请输入内容", {icon: 2, time: 2000});
return;
}
$.ajax({
type: "post",
url: "/approval/application/save.afca",
dataType:'json',
data: {
name: data.toolName,
targerId: data.id,
status: 0,
type: 'script',
describe: $('.textCon').val(),
key: 'script',
supUser:userName
},
success: function (data) {
var message = data.msg;
if(data.code === '0'){
obj.del();
layer.close(index);
layer.msg(message,{icon: 1,time:2000});
tableObj.reload({
url:'/cd/workPlatform/tool/queryTools.afca'
});
} else {
layer.alert(message, {
icon: 2,title:'提示'
});
return;
}
},
error: function () {
}
})
}
});
getAllUser();
$('.laytable-cell-checkbox').eq(0).empty();
} else if(obj.event === 'del'){
layer.confirm('确认删除么', function(index) {
$.ajax({
type: "post",
url: "/cd/workPlatform/tool/remove.afca",
dataType:'json',
data: "id="+data.id,
dataType: "json",
success: function (data) {
// console.log(data);
var message = data.msg;
var code = data.code;
// console.log(message);
// console.log(code);
if(data.code === '0'){
//obj.del();
layer.close(index);
layer.alert(message,{icon: 1,time:2000});
tableObj.reload({
url:'/cd/workPlatform/tool/queryTools.afca'
});
} else {
layer.alert(message, {
icon: 2,title:'提示'
});
return;
}
},
error: function () {
} })
});
//编辑脚本定义
}else if(obj.event === 'edit'){
//之前版本
// window.location.href='workToolEdit.html?toolSceneId='+data.toolSceneId+'&'+'id='+data.id;
//脚本编辑弹出层
var name = encodeURIComponent(data.toolName);
// console.log(data.toolName);
parent.layer.open({
type: 2,
title: '编辑脚本定义',
// title:data.to,
shadeClose: true,
shade: 0.8,
// maxmin: true,
area: ['100%', '100%'],
content: 'html/taskManagement/scriptManagement/workToolEdit.html?toolSceneId='+data.toolSceneId+'&'+'id='+data.id
});
}else if(obj.event === 'showInformation'){
//脚本展示弹出层
var name = encodeURIComponent(data.toolName);
// console.log(data.toolName);
parent.layer.open({
type: 2,
title: '展示脚本定义',
// title:data.to,
shadeClose: true,
shade: 0.8,
// maxmin: true,
area: ['100%', '100%'],
content: 'html/taskManagement/scriptManagement/showScriptInformation.html?id='+data.id
});
}
else if(obj.event ==='jump'){
// window.location.href='openScriptParaVerManagement.html?toolId='+data.id;
var name = encodeURIComponent(data.toolName);
// console.log(data.toolName);
parent.layer.open({
type: 2,
title: '参数版本管理',
// title:data.to,
shadeClose: true,
shade: 0.8,
// maxmin: true,
area: ['100%', '100%'],
content: 'html/taskManagement/scriptManagement/openScriptParaVerManagement.html?toolId='+data.id+"&jiaoben="+name+"&banben="+data.version+"&scriptLanguage="+data.scriptLanguage+"&categoryName="+data.categoryName+"&=status"+data.status
});
}
});
//html代码
<script type="text/html" id="barDemo">
<!--操作工具-->
<a href="" lay-event="edit">编辑</a>
<a href="" lay-event="jump">参数管理</a>
<a href="" lay-event="del">删除</a>
{{# if (d.status !="1"){}}
<a href="" lay-event="check">发布申请</a>
{{#}}}
</script>
layui中table表格的操作列(删除,编辑)等按钮的操作的更多相关文章
- 关于html中table表格tr,td的高度和宽度
关于html中table表格tr,td的高度和宽度 关于html中table表格tr,td的高度和宽度 做网页的时候经常会遇到各种各样的问题,经常遇到的一个就是会碰到表格宽度对不齐的问题.首先,来分析 ...
- jQuery遍历Table表格的行和列
遍历Table表格的行和列,在开发中比较常用的功能,特别是前端开发人员,不多说,直接上代码,下面代码只是弹出第一列字段,请各位自己根据需求修改和扩展! <!DOCTYPE html PUBLIC ...
- jQuery 中使用 DOM 操作节点,对页面中的表格实现增、删、查、改操作
查看本章节 查看作业目录 需求说明: 在 jQuery 中使用 DOM 操作节点,对页面中的表格实现增.删.查.改操作 点击"增加"超链接时,将表格中的第一条数据添加到表格的末尾 ...
- bootstrap table表格属性、列属性、事件、方法
留存一份,原文地址http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/ 表格参数 表格的参数定义在 jQuery.fn.bootst ...
- asp.net table表格表头及列固定实现
http://blog.csdn.net/zdw_wym/article/details/48630337 在开发中常会遇到table表格中列特别多,下拉后,表头就看不见了,水平滚动后,第1.2列就看 ...
- 记一次LayUI中Table动态添加列数据
这次在开发中遇到,有列数不固定的情况.废话不多说,先上图,在上代码. 下面上JS代码 function SearchData() { var dYear = $("#DYear") ...
- WPF下的Richtextbox中实现表格合并,添加删除行列等功能
.Net中已有现在的方法实现这些功能,不过可能是由于未完善,未把方法公开出来.只能用反射的方法去调用它. 详细信息可以查看.Net Framework 的源代码 http://referencesou ...
- 刷连记录的迟到检测---Table表格增加一列值
公司OA新增加了 刷脸记录 ,用于查看自己是否迟到,但是没有什么提醒,于是乎自己写了一个脚本 刷连记录 类似于这样的: 运行脚本后,是这个样子的: 擦,我本月已经迟到了 3次了.... 拖拽 刷脸记录 ...
- html中table表格标题固定表数据行出现滚动条
需求 web系统中有的用户不喜欢分页,希望数据能在一个页面中全部显示出来. 但是页面中是有滚动条的,当查看下面的数据时就不知道数据行中的列对应的是哪个标题的列. 也就是无法知道这个列是什么数据. 所以 ...
随机推荐
- Mysql中的JSON系列操作函数
前言 JSON是一种轻量级的数据交换格式,采用了独立于语言的文本格式,类似XML,但是比XML简单,易读并且易编写.对机器来说易于解析和生成,并且会减少网络带宽的传输. JSON的格式非常简单:名称/ ...
- python中的else子句
在一般的语言中else子句一般是紧跟在if 子句后面,但是python语言中else子句可以不跟在if子句后面,请看下面代码: >>> for n in range(2, 10): ...
- 智能dns或CDN应用中,如何很好的解决DNS缓存问题? - 知乎
智能dns或CDN应用中,如何很好的解决DNS缓存问题? - 知乎 LISP路由器
- 学习web前端之神器sublime text 3
第一次在博客园写博客,以前都是看别人写的技术在自己慢慢的学习.现在想自己把每天学习的东西理解并记录下来,加深下印象以后可以做个回顾.不知道自己能否坚持每周至少写2篇博文. 古话说的好:工欲善其事,必先 ...
- 【开源类库学习】MBProgressHUD(提示框)
新博客: http://www.liuchendi.com MBProgressHUD是一个开源类库,实现了各种样式的提示框, 下载地址:https://github.com/jdg/MBProgre ...
- CentOS6 安装golang
CentOS6 安装golang 下载 wget http://golangtc.com/static/go/1.8/go1.8.linux-amd64.tar.gz 1 1 1 解压 tar -xz ...
- 【JUnit4.10源码分析】6.1 排序和过滤
abstract class ParentRunner<T> extends Runner implements Filterable,Sortable 本节介绍排序和过滤. (尽管JUn ...
- Android Volley框架的使用(四)图片的三级缓存策略(内存LruCache+磁盘DiskLruCache+网络Volley)
在开发安卓应用中避免不了要使用到网络图片,获取网络图片很简单,但是需要付出一定的代价——流量.对于少数的图片而言问题不大,但如果手机应用中包含大量的图片,这势必会耗费用户的一定流量,如果我们不加以处理 ...
- 倍福TwinCAT(贝福Beckhoff)常见问题(FAQ)人机界面Paintbuffer Overflow怎么办
当在界面上绘制了太多元素时,点击运行会在左上角弹出对话框提示内容容量不够 在英文版的说明中,点击Visualization Manager就可以进行设置 更多教学视频和资料下载,欢迎关注以 ...
- Pinterest架构:两年内月PV从零到百亿
Pinterest正经历了指数级曲线般的增长,每隔一个半月就翻番.在这两年里,Pinterest,从 每月PV量0增长到100亿,从两名c创始人和一个工程师成长为四十个工程师,从一台MySQL 服务器 ...