浏览代码

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

amiart 7 年之前
父节点
当前提交
966fb77f49
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/bootstrap-table.js

+ 5 - 1
src/bootstrap-table.js

@@ -1254,7 +1254,11 @@
     initSearch () {
       if (this.options.sidePagination !== 'server') {
         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
         }