layui怎么隐藏列,该如何操作?加载完表格的操作:layui怎么隐藏列,该如何操作?加载完表格的操作: tableIns = table.render({ elem: '#tableDemo', url: '/pltTaskInfo/getDataByCondition', toolbar: '#toolbarDemo', cols: [cols], defaultToolbar: ['filter'], height: 'full-80', page: { limit: TableUIObj.onePageRecoeds, limits: [10, 2
tableIns = table.render({
elem: '#tableDemo',
url: '/pltTaskInfo/getDataByCondition',
toolbar: '#toolbarDemo',
cols: [cols],
defaultToolbar: ['filter'],
height: 'full-80',
page: {
limit: TableUIObj.onePageRecoeds,
limits: [10, 20, 30, 40, 50]
},
where: {
pltId: pltId,
deptId: deptId,
orderbyFields: upperFieldMatch(TableUIObj.orderbyFields),
orderbyUpdown: TableUIObj.orderbyUpdown
},
autoSort: false,
parseData: function (res) { //res 即为原始返回的数据
return {
"code": 0, //解析接口状态
"data": res.data, //解析数据列表
"count": res.totleNum, //解析数据长度
};
},
request: {
limitName: 'pageSize' //每页数据量的参数名,默认:limit
},
done: function (res) {
if(pltType == '01'){
$('#add').hide();
}else{
$('#import').hide();
//隐藏某一列
$("[data-field='controlLevel']").css('display','none');
}
})
或者layui数据表格中隐藏列方式,如果直接在定义列时隐藏: taskNo: {field: 'taskNo', title: '编码', sort: true, hide: true},
var colShowObj = {
taskNo: {field: 'taskNo', title: '编码', sort: true, hide: true},
controlLevel: {
field: 'controlLevel', title: '关注等级', sort: true, hide: false, templet: function (d) {
return dictionaryObj['CONTROL_LEVEL']['object'][d.controlLevel] || ''
}
},
}
沃梦达教程
本文标题为:layui table如何隐藏列


猜你喜欢
- jsPlumb+vue创建字段映射关系 2023-10-08
- ajax实现输入提示效果 2023-02-14
- layui数据表格以及传数据方式 2022-12-13
- 关于 html:如何从 css 表中删除边距和填充 2022-09-21
- vue keep-alive 2023-10-08
- 深入浅析AjaxFileUpload实现单个文件的 Ajax 文件上传库 2022-12-15
- JS实现左侧菜单工具栏 2022-08-31
- 基于CORS实现WebApi Ajax 跨域请求解决方法 2023-02-14
- javascript 判断当前浏览器版本并判断ie版本 2023-08-08
- 1 Vue - 简介 2023-10-08