Browse Source

Fix #3696: can't search data with formatter (#3873)

amiart 7 years ago
parent
commit
a0957e97c5
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/bootstrap-table.js

+ 6 - 6
src/bootstrap-table.js

@@ -1295,16 +1295,16 @@
                   value = value[props[i]]
                   value = value[props[i]]
                 }
                 }
               }
               }
-
-              // Fix #142: respect searchForamtter boolean
-              if (column && column.searchFormatter) {
-                value = Utils.calculateObjectValue(column,
-                  this.header.formatters[j], [value, item, i], value)
-              }
             } else {
             } else {
               value = item[key]
               value = item[key]
             }
             }
 
 
+            // Fix #142: respect searchForamtter boolean
+            if (column && column.searchFormatter) {
+              value = Utils.calculateObjectValue(column,
+                this.header.formatters[j], [value, item, i], value)
+            }
+            
             if (typeof value === 'string' || typeof value === 'number') {
             if (typeof value === 'string' || typeof value === 'number') {
               if (this.options.strictSearch) {
               if (this.options.strictSearch) {
                 if ((`${value}`).toLowerCase() === s) {
                 if ((`${value}`).toLowerCase() === s) {