diff --git a/packages/react-bootstrap-table2/src/bootstrap-table.js b/packages/react-bootstrap-table2/src/bootstrap-table.js index 769fa78..1a1d16d 100644 --- a/packages/react-bootstrap-table2/src/bootstrap-table.js +++ b/packages/react-bootstrap-table2/src/bootstrap-table.js @@ -156,6 +156,7 @@ BootstrapTable.propTypes = { nonExpandable: PropTypes.array, showExpandColumn: PropTypes.bool, onlyOneExpanding: PropTypes.bool, + expandByColumnOnly: PropTypes.bool, expandColumnRenderer: PropTypes.func, expandHeaderColumnRenderer: PropTypes.func }), diff --git a/packages/react-bootstrap-table2/src/row-expand/expand-cell.js b/packages/react-bootstrap-table2/src/row-expand/expand-cell.js index 3df5b1c..e970a13 100644 --- a/packages/react-bootstrap-table2/src/row-expand/expand-cell.js +++ b/packages/react-bootstrap-table2/src/row-expand/expand-cell.js @@ -23,7 +23,7 @@ export default class ExpandCell extends Component { handleClick(e) { const { rowKey, expanded, onRowExpand, rowIndex } = this.props; - onRowExpand(rowKey, expanded, rowIndex, e); + onRowExpand(rowKey, !expanded, rowIndex, e); } render() { diff --git a/packages/react-bootstrap-table2/src/row/event-delegater.js b/packages/react-bootstrap-table2/src/row/event-delegater.js index e666f7e..0a17aa2 100644 --- a/packages/react-bootstrap-table2/src/row/event-delegater.js +++ b/packages/react-bootstrap-table2/src/row/event-delegater.js @@ -32,13 +32,12 @@ export default ExtendBase => selectRow, DELAY_FOR_DBCLICK } = this.props; - const clickFn = () => { if (cb) { cb(e, row, rowIndex); } const key = _.get(row, keyField); - if (expandRow && expandable) { + if (expandRow && expandable && !expandRow.expandByColumnOnly) { if ( (selectRow.mode !== Const.ROW_SELECT_DISABLED && selectRow.clickToExpand) || selectRow.mode === Const.ROW_SELECT_DISABLED