Skip to content

Commit

Permalink
Added checkInvert method, that inverts current selections
Browse files Browse the repository at this point in the history
  • Loading branch information
Real-Gecko committed Jan 25, 2016
1 parent 69bac17 commit 98839b3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,20 @@
this.checkAll_(false);
};

BootstrapTable.prototype.checkInvert = function () {
var that = this;
var rows = that.$selectItem.filter(':enabled');
var checked = rows.filter(':checked');
rows.each(function() {
$(this).prop('checked', !$(this).prop('checked'));
});
that.updateRows();
that.updateSelected();
that.trigger('uncheck-some', checked);
checked = that.getSelections();
that.trigger('check-some', checked);
};

BootstrapTable.prototype.checkAll_ = function (checked) {
var rows;
if (!checked) {
Expand Down

0 comments on commit 98839b3

Please sign in to comment.