Browse Source

Fixed cookie in combination with filter-control + strict search

When using cookie in combination with filter-control and strict search enabled on a column, selecting the empty value would store it as an empty value in cookie. When returning the page and thus getting the cookie, it would result in no results in bootstrap-table because it would literally search for ''.
Valery1991 8 years ago
parent
commit
31e9d898d0
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/extensions/cookie/bootstrap-table-cookie.js

+ 2 - 0
src/extensions/cookie/bootstrap-table-cookie.js

@@ -179,8 +179,10 @@
 
                     applyCookieFilters = function (element, filteredCookies) {
                         $(filteredCookies).each(function (i, cookie) {
+                            if (cookie.text !== '') {
                                 $(element).val(cookie.text);
                                 cachedFilters[cookie.field] = cookie.text;
+                            }                                
                         });
                     };