Skip to content

Commit

Permalink
Fixed search bug in hidden columns
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin committed Jul 16, 2019
1 parent 300e86e commit 8e6b9d5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/bootstrap-table.js
Expand Up @@ -237,10 +237,6 @@ class BootstrapTable {
}

columns.forEach((column, j) => {
if (!column.visible) {
return
}

const class_ = Utils.sprintf(' class="%s"', column['class'])
const unitWidth = column.widthUnit
const width = parseFloat(column.width)
Expand All @@ -252,6 +248,10 @@ class BootstrapTable {
? (!column.showSelectTitle ? '36px' : undefined)
: (width ? width + unitWidth : undefined))

if (typeof column.fieldIndex === 'undefined' && !column.visible) {
return
}

if (typeof column.fieldIndex !== 'undefined') {
this.header.fields[column.fieldIndex] = column.field
this.header.styles[column.fieldIndex] = align + style
Expand All @@ -264,6 +264,10 @@ class BootstrapTable {
this.header.cellStyles[column.fieldIndex] = column.cellStyle
this.header.searchables[column.fieldIndex] = column.searchable

if (!column.visible) {
return
}

if (this.options.cardView && (!column.cardVisible)) {
return
}
Expand Down

0 comments on commit 8e6b9d5

Please sign in to comment.