隐藏 bootstrap table 列

mac2025-08-06  10

第一种 (showColumn),但是在showColumns 中显示不出来,在onCheck 点击事件也获取不到值` $('#table').bootstrapTable('hideColumn', 'age');

显示的话需要手动显示 : $('#table').bootstrapTable('showColumn', 'name');

2.第二种 隐(cellStyle),在showColumns 中也显示不出来,但是在onCheck 点击事件中可以获取到值

field: 'sim_iccid', title: 'SIM卡号', sortable: false, align: 'center', valign: 'middle', colspan: 1, cellStyle: function (value, row, index) { if (value != undefined) { $('#table').bootstrapTable('hideColumn', 'sim_iccid'); return {css: {"display": "none"}} } } 第三种 (visible:false),在showColumns 中可以显示,并且在onCheck中也可以获取到 field: 'sim_iccid', title: 'SIM卡号', sortable: false, align: 'center', valign: 'middle', colspan: 1, visible:false
最新回复(0)