1.layui 删除一行 或多行 实例代码;(这个是删除表名的行数据,后台并没有删除,自己去实现很好实现的哟)
var DeleteData = [];
var FilterArray = function (DataIndex) {
DeleteData = filter_array(DeleteData);
for (var i = 0; i < DeleteData.length; i++) {
if (DeleteData[i] == DataIndex) {
delete DeleteData[i];
}
DeleteData = filter_array(DeleteData);
}
return DeleteData;
}
function filter_array(array) {
return array.filter(item => item);
}
//单击行勾选checkbox事件
$(document).on("click", ".layui-table-body table.layui-table tbody tr", function () {
var index = $(this).attr('data-index');
var tableBox = $(this).parents('.layui-table-box');
//存在固定列
if (tableBox.find(".layui-table-fixed.layui-