浏览代码

Fixed cookie search cannot work bug

zhixin 6 年之前
父节点
当前提交
ac9bc50ab3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/extensions/cookie/bootstrap-table-cookie.js

+ 1 - 1
src/extensions/cookie/bootstrap-table-cookie.js

@@ -329,7 +329,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
   onSearch (event) {
     super.onSearch(event)
 
-    if ($(event.currentTarget).parent().hasClass('search')) {
+    if (this.options.search) {
       UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText)
     }
     UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)