Skip to content

Commit ef27718

Browse files
committed
Fix bug: check all does not work in some case.
1 parent 66fca4c commit ef27718

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Bootstrap table displays data in a tabular format and offers rich support to rad
2121
- [x] Fix #102: Wrong `options.columns` initialization.
2222
- [x] Fix #121: Add extensions for bootstrap table.
2323
- [x] Fix #138: IE8 search data and remove method error.
24-
- [x] Fix bug: sorter does not work in some case.
24+
- [x] Fix bug: sorter and check all do not work in some case.
2525
- [x] Add `bootstrap-table-nl-NL.js` and `bootstrap-table-el-GR.js`.
2626
- [x] Support search without data-field set, trim search input.
2727
- [x] Fix #81: Allow the `class` to be applied to the radio or checkbox row.

src/bootstrap-table.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,11 @@
390390
}
391391

392392
this.$selectAll = this.$header.find('[name="btSelectAll"]');
393-
this.$selectAll.off('click').on('click', function () {
394-
var checked = $(this).prop('checked');
395-
that[checked ? 'checkAll' : 'uncheckAll']();
396-
});
393+
this.$container.off('click', '[name="btSelectAll"]')
394+
.on('click', '[name="btSelectAll"]', function () {
395+
var checked = $(this).prop('checked');
396+
that[checked ? 'checkAll' : 'uncheckAll']();
397+
});
397398
};
398399

399400
BootstrapTable.prototype.initData = function (data, append) {
@@ -1284,15 +1285,15 @@
12841285

12851286
BootstrapTable.prototype.checkAll = function () {
12861287
this.$selectAll.add(this.$selectAll_).prop('checked', true);
1287-
this.$selectItem.prop('checked', true);
1288+
this.$selectItem.filter(':enabled').prop('checked', true);
12881289
this.updateRows(true);
12891290
this.updateSelected();
12901291
this.trigger('check-all');
12911292
};
12921293

12931294
BootstrapTable.prototype.uncheckAll = function () {
12941295
this.$selectAll.add(this.$selectAll_).prop('checked', false);
1295-
this.$selectItem.prop('checked', false);
1296+
this.$selectItem.filter(':enabled').prop('checked', false);
12961297
this.updateRows(false);
12971298
this.updateSelected();
12981299
this.trigger('uncheck-all');

0 commit comments

Comments
 (0)