Skip to content

Commit

Permalink
Merge pull request #6079 from wenzhixin/fix/5991
Browse files Browse the repository at this point in the history
Fixed toggle all columns error when column switchable is false.
  • Loading branch information
UtechtDustin authored Mar 13, 2022
2 parents a86c8de + 6747b98 commit f567d9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2796,7 +2796,11 @@ class BootstrapTable {
_toggleAllColumns (visible) {
for (const column of this.columns.slice().reverse()) {
if (column.switchable) {
if (!visible && this.options.showColumns && this.getVisibleColumns().length === this.options.minimumCountColumns) {
if (
!visible &&
this.options.showColumns &&
this.getVisibleColumns().filter(it => it.switchable).length === this.options.minimumCountColumns
) {
continue
}
column.visible = visible
Expand Down

0 comments on commit f567d9d

Please sign in to comment.