Browse Source

Improving logic when there is not any value in the controls

djhvscf 7 years ago
parent
commit
f113108849
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/extensions/filter-control/bootstrap-table-filter-control.js

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

@@ -670,14 +670,21 @@
                 table = header.closest('table'),
                 table = header.closest('table'),
                 controls = header.find(getCurrentSearchControls(that)),
                 controls = header.find(getCurrentSearchControls(that)),
                 search = that.$toolbar.find('.search input'),
                 search = that.$toolbar.find('.search input'),
+                hasValues = false,
                 timeoutId = 0;
                 timeoutId = 0;
 
 
             $.each(that.options.valuesFilterControl, function (i, item) {
             $.each(that.options.valuesFilterControl, function (i, item) {
+                hasValues = item.value !== '';
                 item.value = '';
                 item.value = '';
             });
             });
 
 
             setValues(that);
             setValues(that);
 
 
+            //If there is not any value in the controls
+            if(!hasValues) {
+                return;
+            }
+
             // Clear each type of filter if it exists.
             // Clear each type of filter if it exists.
             // Requires the body to reload each time a type of filter is found because we never know
             // Requires the body to reload each time a type of filter is found because we never know
             // which ones are going to be present.
             // which ones are going to be present.