Skip to content

Commit a23c290

Browse files
committed
fix #466
1 parent 690eb12 commit a23c290

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/BootstrapTable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ class BootstrapTable extends Component {
399399
let result = true;
400400
if (this.props.selectRow.onSelectAll) {
401401
result = this.props.selectRow.onSelectAll(isSelected,
402-
isSelected ? this.store.get() : []);
402+
isSelected ? this.store.get() : this.store.getRowByKey(this.state.selectedRowKeys));
403403
}
404404

405405
if (typeof result == 'undefined' || result !== false) {

src/store/TableDataStore.js

+7
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ export class TableDataStore {
8585
this.selected = selectedRowKeys;
8686
}
8787

88+
getRowByKey(keys) {
89+
return keys.map(key => {
90+
const result = this.data.filter(d => d[this.keyField] === key);
91+
if (result.length !== 0) return result[0];
92+
});
93+
}
94+
8895
getSelectedRowKeys() {
8996
return this.selected;
9097
}

0 commit comments

Comments
 (0)