ソースを参照

Fix 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 年 前
コミット
3a8e1c1a0d
1 ファイル変更4 行追加2 行削除
  1. 4 2
      src/extensions/cookie/bootstrap-table-cookie.js

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

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