| | |
| | | } |
| | | }); |
| | | |
| | | // 添加 |
| | | $("#cstmrAddBtn").click(function () { |
| | | showEditModel(); |
| | | }); |
| | | |
| | | // 删除 |
| | | form.on('submit(cstmrDel)', function (data) { |
| | | let checkStatus = layui.table.checkStatus('cstmr').data; |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | }); |
| | | |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(cstmr)', function (obj) { |
| | | var searchData = {}; |
| | |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(cstmr)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(cstmr)', function(obj){ |