Browse Source

Added new option disableUnusedSelectOptions

Dennis Hernández 9 years ago
parent
commit
9001c13706

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

@@ -21,7 +21,7 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 ### filterShowClear
 
 * type: Boolean
-* description: Set true to add a button to clear all the controls added by this plugin
+* description: Set true to add a button to clear all the controls added by this plugin.
 * default: `false`
 
 ### alignmentSelectControlOptions
@@ -30,6 +30,12 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * description: Set the alignemnt of the select control options. Use Use `left`, `right` or `auto`.
 * default: `undefined`
 
+### disableUnusedSelectOptions
+
+* type: Boolean
+* description: Set to true in order to disable the options that are not in the table. This option does not work on server-side pagination.
+* default: `false`
+
 ## Column options
 
 ### filterControl

+ 4 - 2
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -223,12 +223,14 @@
 
                 sortSelectControl(selectControl);
 
-                disableOptionSelectControl(selectControl, uniqueValues);
+                if (that.options.disableUnusedSelectOptions) {
+                    disableOptionSelectControl(selectControl, uniqueValues);
+                }
             }
         });
     };
 
-    var escapeID = function( id ) {
+    var escapeID = function(id) {
        return String(id).replace( /(:|\.|\[|\]|,)/g, "\\$1" );
    };