数据表格加上操作。

<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

对删除按钮进行操作。

//监听工具条
table.on('tool(planScan)', function(obj) {
var data = obj.data, layEvent = obj.event; //获得 lay-event 对应的值;
if (obj.event === 'scan_item') {
$('input[name=innerNumber]').val(data.innerNumber);
}
if (layEvent === 'del') {
layer.confirm('确定删除这条数据吗?', function(index) {
var loading = layer.load(2);
//提交 Ajax 成功后,关闭当前弹层并重载表格
admin.req({
method : 'GET',
url : 'inventoryRecord/del.do',
data : {
uniqueId :data.uniqueId ,
},
success : function(res) { layer.close(loading);
if (res.code == 0) {
layui.table.reload('planScan'); //重载表格
//layer.msg("你好!"+res.code);
layer.close(index); //执行关闭
} else {
layer.msg('删除异常');
}
}
});
});
} //if(layEvent === 'del') 后面的
});

layui的数据表格加上操作的更多相关文章

  1. layui table数据表格reload where参数保留问题

    layui table数据表格reload where参数保留问题 在使用layui过程中多多少少会遇到些问题 table reload 有个坑:reload时where参数会保留上次的参数,如果用 ...

  2. layui table 数据表格 隐藏列

    现在国内的模板,也就layui一家独大了,其中的数据表格功能强大,但我不会用python或者django拼接json,输出发送给数据表格,那只好用笨办法,循环遍历吧. 数据表格中保留id列,是为了编辑 ...

  3. layui table 数据表格固定列的行高和table其他列的行高不一致

    1.问题描述:使用layui的table数据表格,固定某一列,这样表格中数据的宽度超出屏幕宽度时,固定列可以一直显示在屏幕中,不会随着底部滚动栏左右的拖动而变化位置.但是遇到一个问题,就是固定列的行高 ...

  4. layui:数据表格如何合并单元格

    layui.use('table', function () { var table = layui.table; table.render({ elem: '#applyTab' , url: '$ ...

  5. layui动态数据表格-分页

    数据结构 $list = [ [,'], [,] ]; $json[; $json['; $json[; $json['data'] = $list; return json($json); 代码: ...

  6. Layui 改变数据表格样式覆盖

    改变表格行高.layui-table-cell{ height:40px; line-height: 36px; } 改变复选框高宽和定位等等.layui-table-view .layui-form ...

  7. LayUI之数据表格扩展

    1.点击一行 选中 以下代码需要在表格渲染完成时加载. 1)当单击表格行时,把单选按钮设为选中状态 //当单击表格行时,把单选按钮设为选中状态 $(document).on("click&q ...

  8. layui中table表格的操作列(删除,编辑)等按钮的操作

    暂停和中止按钮功能 if (obj.event === 'del') { layer.confirm('确认中止么', function (index) { $.ajax({ type: " ...

  9. LayUI之table数据表格获取行、行高亮等相关操作

    前言 目前LayUI数据表格既美观有不乏一些实用功能.基本上表格应有的操作已经具备,LayUI作者[贤心]肯定是煞费苦心去优化,此处致敬.但是实话实话,如果单纯那数据表格功能来说,EasUI的数据表格 ...

随机推荐

  1. hashmap C++实现

    hashmap.h #ifndef _HASHMAP_H_ #define _HASHMAP_H_ template<class Key, class Value> class HashN ...

  2. cm日志的清理

    #过一段时间后,cm server的空间越来越大 #删除日志/bin/rm /var/lib/cloudera-host-monitor/ts/*/partition*/* -rf/bin/rm /v ...

  3. [转帖]Intro Guide to Dockerfile Best Practices

    Intro Guide to Dockerfile Best Practices By Tibor Vass July 02 2019    https://blog.docker.com/2019/ ...

  4. C++游戏服务器编程笔记 IP详解

    C++游戏服务器编程笔记 IP详解 IP详解 INTERNET的历史 上世纪60年底起源于美国 1992年,Internet上的主机超过了100万台 现在已经是现代文明人的必需品    TCP/IP的 ...

  5. linux 三剑客之sed常用总结

    sed 列出5-7行 [root@www ~]# nl /etc/passwd | sed -n '5,7p' -n不在处理前打印,搜索root,/p打印 nl /etc/passwd | sed ' ...

  6. 爬虫实例学习——爬取酷狗TOP500数据

    酷狗网址:https://www.kugou.com/yy/rank/home/1-8888.html?from=rank 环境:eclipse+pydev import requests from ...

  7. The Party and Sweets CodeForces - 1159C (拓排)

    优化连边然后拓排. #include <iostream> #include <sstream> #include <algorithm> #include < ...

  8. leetcode hard

    # Title Solution Acceptance Difficulty Frequency     4 Median of Two Sorted Arrays       27.2% Hard ...

  9. iis 8.0 HTTP 错误 404.3 server 2012

    最近在学习WCF,发现将网站WCF服务放到IIS上时不能正常运行,从网上搜了一下: 解决方法,以管理员身份进入命令行模式,运行: "%windir%\Microsoft.NET\Framew ...

  10. java接口自动化测试小dome

    GitHub地址:https://github.com/leonInShanghai/InterfaceAutomation 这个dome 请求 https://www.v2ex.com/api/no ...