ソースを参照

Add searchTimeOut

D0d0 11 年 前
コミット
7ee8961d2b
1 ファイル変更3 行追加1 行削除
  1. 3 1
      src/bootstrap-table.js

+ 3 - 1
src/bootstrap-table.js

@@ -165,6 +165,7 @@
         checkboxHeader: true,
         sortable: true,
         maintainSelected: false,
+        searchTimeOut: 500,
 
         rowStyle: function (row, index) {return {};},
 
@@ -640,12 +641,13 @@
                 '</div>');
 
             this.$toolbar.append(html.join(''));
+            var timeOut = this.options.searchTimeOut;
             $search = this.$toolbar.find('.search input');
             $search.off('keyup').on('keyup', function (event) {
                 clearTimeout(timeoutId); // doesn't matter if it's 0
                 timeoutId = setTimeout(function () {
                     that.onSearch(event);
-                }, 500); // 500ms
+                }, timeOut);
             });
         }
     };