Browse Source

allow `filterBy` to accept an array of values

Damon Timm 10 years ago
parent
commit
93962cc2b7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/bootstrap-table.js

+ 5 - 1
src/bootstrap-table.js

@@ -1085,7 +1085,11 @@
             // Check filter
             this.data = f ? $.grep(this.options.data, function (item, i) {
                 for (var key in f) {
-                    if (item[key] !== f[key]) {
+                    if ($.isArray(f[key])) {
+                        if ($.inArray(item[key], f[key]) === -1) {
+                            return false;
+                        }
+                    } else if (item[key] !== f[key]) {
                         return false;
                     }
                 }