//初始化table组件以及数据
function initTableAndData() {
layui.use('table', function () {
var table = layui.table;
table.render({
elem: '#building_number_manager',
method: 'post',
url:'/admin/initTableData',
cellMinWidth: 80,
cols: [
[
{type: 'checkbox'},
{field: 'id', title: '数据ID'},
{field: 'residential_id', title: '小区ID'},
{field: 'building_number', title: '栋号'}
]
],
page: true,
even: true,
/*隐藏表格*/
done:function(res,curr,count){
var tables = $("#building_number_manager").next().find(".layui-table-box");
tables.find("[data-field='id']").css("display","none"); //data-field的值就是你想要隐藏的某一列的field
},
response: {
dataName: 'data'//不加这个没有数据
, msgName: 'msg'
, statusName: 'status'
, statusCode: 0
}
});
});
}