Browse Source

respect the searchFormatter option

bsa01 10 years ago
parent
commit
efbcd56b4b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/extensions/filter-control/bootstrap-table-filter-control.js

+ 5 - 1
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -379,9 +379,13 @@
                 var thisColumn = that.columns[$.fn.bootstrapTable.utils.getFieldIndex(that.columns, key)];
                 var fval = fp[key].toLowerCase();
                 var value = item[key];
-                value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
+                
+                // Fix #142: search use formated data
+                if (thisColumn && thisColumn.searchFormatter) {
+                    value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
                     that.header.formatters[$.inArray(key, that.header.fields)],
                     [value, item, i], value);
+                }
 
                 if(thisColumn.filterStrictSearch){
                     if (!($.inArray(key, that.header.fields) !== -1 &&