Browse Source

fix build error

djhvscf 4 years ago
parent
commit
021b0d8c65
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/extensions/filter-control/bootstrap-table-filter-control.js

+ 8 - 3
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -371,6 +371,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
     const that = this
     const table = this.$el.closest('table')
+    const cookies = UtilsFilterControl.collectBootstrapTableFilterCookies()
     const controls = UtilsFilterControl.getSearchControls(that)
     // const search = Utils.getSearchInput(this)
     let hasValues = false
@@ -390,11 +391,15 @@ $.BootstrapTable = class extends $.BootstrapTable {
     // Cache controls again
     UtilsFilterControl.setValues(that)
 
-    // clear cookies once the filters are clean. Should clear only Filtercontrol cookie
+    // clear cookies once the filters are clean
     clearTimeout(timeoutId)
     timeoutId = setTimeout(() => {
-      if (that.options.cookie) {
-        that.deleteCookie('filterControl')
+      if (cookies && cookies.length > 0) {
+        $.each(cookies, (i, item) => {
+          if (that.deleteCookie !== undefined) {
+            that.deleteCookie(item)
+          }
+        })
       }
     }, that.options.searchTimeOut)