先清空原table内容(清缓存)后刷新Options添加新columns
原缓存不清空,会导致页面数据残留
$('#customReport-pre').bootstrapTable('destroy'); //重点:要先清空原table
$('#customReport-pre').bootstrapTable('refreshOptions', {
columns: [tabCol],
pageNumber: 1
});
$('#customReport-pre').bootstrapTable({
pagination : true,
pageNumber : 1,
pageSize : 10,
pagePosition : 'bottom',
fit:true,
fitColumns:true,
striped: true,
border: false,
columns : [ tabCol ], //tabCol动态columns
data: {
total: data.total,
rows: data.rows
}
});