浏览代码

Fix the strict search mode

Dennis Hernández 10 年之前
父节点
当前提交
40459abc4f

+ 5 - 0
src/extensions/filter-control/README.md

@@ -37,6 +37,11 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * description: If the datepicker option is set use this option to configure the datepicker with the native options. Use this way: `data-filter-datepicker-options='{"autoclose":true, "clearBtn": true, "todayHighlight": true}'`.
 * default: `undefined`
 
+### filterStrictSearch
+* type: Boolean
+* description: Set to true if you want to use the strict search mode.
+* default: `false`
+
 ## Events
 
 ### onColumnSearch(column-search.bs.table)

+ 2 - 2
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -374,10 +374,10 @@
                     that.header.formatters[$.inArray(key, that.header.fields)],
                     [value, item, i], value);
 
-                if(thisColumn.filterStrictSearch===true){
+                if(thisColumn.filterStrictSearch){
                     if (!($.inArray(key, that.header.fields) !== -1 &&
                         (typeof value === 'string' || typeof value === 'number') &&
-                        value.toLowerCase() === fval.toLowerCase())) {
+                        value.toString().toLowerCase() === fval.toString().toLowerCase())) {
                         return false;
                     }
                 }