Skip to content

Commit

Permalink
Merge pull request #7660 from wenzhixin/fix/bug-7588
Browse files Browse the repository at this point in the history
Fixed column is undefined bug in updateFieldGroup when using refreshO…
  • Loading branch information
wenzhixin authored Dec 21, 2024
2 parents ce20547 + 830e8f3 commit 7b9c41d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ class BootstrapTable {
this.columns = []
this.fieldsColumnsIndex = []

Utils.setFieldIndex(this.options.columns)
if (this.optionsColumnsChanged !== false) {
Utils.setFieldIndex(this.options.columns)
}

this.options.columns.forEach((columns, i) => {
columns.forEach((_column, j) => {
Expand Down Expand Up @@ -2434,6 +2436,7 @@ class BootstrapTable {
if (Utils.compareObjects(this.options, options, true)) {
return
}
this.optionsColumnsChanged = !!options.columns
this.options = Utils.extend(this.options, options)
this.trigger('refresh-options', this.options)
this.destroy()
Expand Down
4 changes: 0 additions & 4 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ export default {
const underColumns = allColumns.filter(col => col.fieldIndex === i)
const column = underColumns[underColumns.length - 1]

if (!column) {
continue
}

if (underColumns.length > 1) {
for (let j = 0; j < underColumns.length - 1; j++) {
underColumns[j].visible = column.visible
Expand Down

0 comments on commit 7b9c41d

Please sign in to comment.