Browse Source

Merge pull request #4252 from wenzhixin/fix/3774

Added column field to formatters function
文翼 6 years ago
parent
commit
2b3c393626
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/bootstrap-table.js

+ 2 - 1
src/bootstrap-table.js

@@ -1369,6 +1369,7 @@
     }
 
     initSearch () {
+      this.filterOptions = this.options.filterOptions || this.options.filterOptions
       if (this.options.sidePagination !== 'server') {
         if (this.options.customSearch) {
           this.data = Utils.calculateObjectValue(this.options, this.options.customSearch,
@@ -1444,7 +1445,7 @@
             // Fix #142: respect searchForamtter boolean
             if (column && column.searchFormatter) {
               value = Utils.calculateObjectValue(column,
-                this.header.formatters[j], [value, item, i], value)
+                this.header.formatters[j], [value, item, i, column.field], value)
             }
 
             if (typeof value === 'string' || typeof value === 'number') {