table.render({
elem: "#test",
// id: "table_cell_data",
url: "http://localhost:3000/all",
toolbar: "#toolbarDemo", //指向自定义工具栏模板选择器
defaultToolbar: [], //除去打印,导出
title: "用户数据表",
cols: [[ ]],
page: false,
//指定某一行过滤隐藏
done: function (res, curr, count) {
console.log(res.data);
merge(res);
$('tr').css({'background-color': '#009688', 'color': '#fff'});//表头样式修改
var that = this.elem.next();
console.log(this.elem)
console.log(that)
res.data.forEach(function (item, index) {
if (item.accstatus === "封禁") {
var tr = that.find(".layui-table-box tbody tr[data-index='" + index + "']");
tr.css("display", "none");
tr.find(".laytable-cell-1-0-9").css("display","none");
}
});
}
});
layui table指定某一行过滤隐藏
最新推荐文章于 2023-03-07 10:03:05 发布