Browse Source

Fix #2545: customSearch not triggering custom function (#3872)

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

+ 5 - 1
src/bootstrap-table.js

@@ -1254,7 +1254,11 @@
     initSearch () {
     initSearch () {
       if (this.options.sidePagination !== 'server') {
       if (this.options.sidePagination !== 'server') {
         if (this.options.customSearch !== $.noop) {
         if (this.options.customSearch !== $.noop) {
-          window[this.options.customSearch].apply(this, [this.searchText])
+          if (typeof this.options.customSearch === 'string') {
+            window[this.options.customSearch].apply(this, [this.searchText])
+          } else {
+            this.options.customSearch.apply(this, [this.searchText])
+          }
           return
           return
         }
         }