Skip to content

Commit

Permalink
improved method
Browse files Browse the repository at this point in the history
  • Loading branch information
madeinfree committed Mar 25, 2016
1 parent ca1c62e commit 449eb1b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ class BootstrapTable extends Component {
isSelectAll() {
const defaultSelectRowKeys = this.store.getSelectedRowKeys();
const allRowKeys = this.store.getAllRowkey();
if (allRowKeys.length === 0) {
return false;
}
if (defaultSelectRowKeys.length !== allRowKeys.length) {
return defaultSelectRowKeys.length === 0 ? false : 'indeterminate';
} else {
if (this.handleDataIsEmpty(allRowKeys)) {
return false;
}
return true;
}
}
Expand All @@ -299,6 +299,10 @@ class BootstrapTable extends Component {
});
}

handleDataIsEmpty = (data) => {
return (data.length === 0 || data === null || data === undefined);
}

handleSort = (order, sortField) => {
if (this.props.options.onSortChange) {
this.props.options.onSortChange(sortField, order, this.props);
Expand Down

0 comments on commit 449eb1b

Please sign in to comment.