Browse Source

Fixed checkAll event bug with sortable checkbox field

zhixin 6 years ago
parent
commit
af2ed319f7
2 changed files with 4 additions and 2 deletions
  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 `pageSize` set to all bug with filter.
 - **Update:** Fixed `jqXHR` `undefined` error using custom ajax.
 - **Update:** Fixed `jqXHR` `undefined` error using custom ajax.
 - **Update:** Fixed `refreshOptions` bug with radio and checkbox.
 - **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 checkbox and not-found td style errors.
 - **Update:** Fixed `hideUnusedSelectOptions` not work bug for filter-control extension.
 - **Update:** Fixed `hideUnusedSelectOptions` not work bug for filter-control extension.
 - **Update:** Fixed `virtualScroll` option bug with treegrid 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 = 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[checked ? 'checkAll' : 'uncheckAll']()
       this.updateSelected()
       this.updateSelected()
     })
     })