一:监听复选框事件
table.on('checkBox(demo)',function(obj){
if (obj.type=='all')
if (obj.type=='all')
return;
if (obj.checked){
checkedArr.push(obj.data.LAY_TABLE_INDEX);
//checkedArr[obj.data.id] = obj.data.LAY_TABLE_INDEX
}
else{
delete checkedArr[obj.data.LAY_TABLE_INDEX];
//delete checkedArr[obj.data.id];
}
});
var checkStatus = table.checkStatus('orderTest'),data = checkStatus.data;
if (checkStatus.isAll){
for (var i=0; i<data.length ; i++){
checkedArr.push[i];
//checkedArr[data[i].id]=i;
}
}
for (var j=0; j<checkedArr.length ; j++){
// $(".layui-table-view .layui-table tbody tr[data-index="+checkedArr[j]+"]").remove();
}
$.each(checkedArr,function(k){
$(".layui-table-view .layui-table tbody tr[data-index="+checkedArr[k]+"]").remove();
});