表格添加显示/隐藏所有列方法 showAllColumns/hideAllColumns

pull/162/head
RuoYi 2020-04-21 13:29:21 +08:00
parent 2bba8c7b73
commit 897ce6e3c2
3 changed files with 12 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -504,6 +504,16 @@ var table = {
hideColumn: function(column, tableId) {
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
$("#" + currentId).bootstrapTable('hideColumn', column);
},
// 显示所有表格列
showAllColumns: function(tableId) {
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
$("#" + currentId).bootstrapTable('showAllColumns');
},
// 隐藏所有表格列
hideAllColumns: function(tableId) {
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
$("#" + currentId).bootstrapTable('hideAllColumns');
}
},
// 表格树封装处理

View File

@ -22,7 +22,7 @@
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<!-- bootstrap-table 表格插件 -->
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20191219}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=20200421}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js}"></script>
<script th:src="@{/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js}"></script>