Browse Source

Merge pull request #1683 from mmerian/develop

Add filterLocal option
wenzhixin 10 years ago
parent
commit
9cde0c4a60

+ 6 - 1
src/extensions/filter-control/README.md

@@ -23,6 +23,11 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * description: Set true to add a button to clear all the controls added by this plugin
 * default: `false`
 
+### filterLocal
+
+* type: Boolean
+* description: Set false to disable local data filtering. This allows you to filter the data on server side when using remote data sources.
+* default: `true`
 
 ## Column options
 
@@ -49,4 +54,4 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 
 ### onColumnSearch(column-search.bs.table)
 
-* Fired when we are searching into the column data
+* Fired when we are searching into the column data

+ 5 - 0
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -238,6 +238,7 @@
             return false;
         },
         filterShowClear: false,
+        filterLocal: true,
         //internal variables
         values: []
     });
@@ -364,6 +365,10 @@
     BootstrapTable.prototype.initSearch = function () {
         _initSearch.apply(this, Array.prototype.slice.apply(arguments));
 
+        if (! this.options.filterLocal) {
+            return;
+        }
+
         var that = this;
         var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;