mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
fix #564
This commit is contained in:
parent
0bf5831b4e
commit
f8a3fedbb2
@ -166,6 +166,7 @@ BootstrapTable.propTypes = {
|
||||
onExpandAll: PropTypes.func,
|
||||
nonExpandable: PropTypes.array,
|
||||
showExpandColumn: PropTypes.bool,
|
||||
onlyOneExpanding: PropTypes.bool,
|
||||
expandColumnRenderer: PropTypes.func,
|
||||
expandHeaderColumnRenderer: PropTypes.func
|
||||
}),
|
||||
|
||||
@ -25,12 +25,13 @@ export default (
|
||||
}
|
||||
|
||||
handleRowExpand = (rowKey, expanded, rowIndex, e) => {
|
||||
const { data, keyField, expandRow: { onExpand } } = this.props;
|
||||
const { data, keyField, expandRow: { onExpand, onlyOneExpanding } } = this.props;
|
||||
|
||||
let currExpanded = [...this.state.expanded];
|
||||
|
||||
if (expanded) {
|
||||
currExpanded.push(rowKey);
|
||||
if (onlyOneExpanding) currExpanded = [rowKey];
|
||||
else currExpanded.push(rowKey);
|
||||
} else {
|
||||
currExpanded = currExpanded.filter(value => value !== rowKey);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user