浏览代码

Merge pull request #4697 from wenzhixin/fix/4693

Fixed checkAll event bug with sortable checkbox field
Dustin Utecht 6 年之前
父节点
当前提交
36473f6612
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 0
      CHANGELOG.md
  2. 3 2
      src/bootstrap-table.js

+ 1 - 0
CHANGELOG.md

@@ -18,6 +18,7 @@ ChangeLog
 - **Update:** Fixed `pageSize` set to all bug with filter.
 - **Update:** Fixed `jqXHR` `undefined` error using custom ajax.
 - **Update:** Fixed `refreshOptions` bug with radio and checkbox.
+- **Update:** Fixed `checkAll` event bug with sortable checkbox field.
 - **Update:** Fixed checkbox and not-found td style errors.
 - **Update:** Fixed `hideUnusedSelectOptions` not work bug for filter-control extension.
 - **Update:** Fixed `virtualScroll` option bug with treegrid extension.

+ 3 - 2
src/bootstrap-table.js

@@ -360,8 +360,9 @@ class BootstrapTable {
     }
 
     this.$selectAll = this.$header.find('[name="btSelectAll"]')
-    this.$selectAll.off('click').on('click', ({currentTarget}) => {
-      const checked = $(currentTarget).prop('checked')
+    this.$selectAll.off('click').on('click', e => {
+      e.stopPropagation()
+      const checked = $(e.currentTarget).prop('checked')
       this[checked ? 'checkAll' : 'uncheckAll']()
       this.updateSelected()
     })