浏览代码

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 年之前
父节点
当前提交
31e9d898d0
共有 1 个文件被更改,包括 2 次插入0 次删除
  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;
+                            }                                
                         });
                     };