This commit is contained in:
AllenFang 2018-10-11 00:08:13 +08:00
parent dd54294382
commit 15731932cf
3 changed files with 3 additions and 3 deletions

View File

@ -156,6 +156,7 @@ BootstrapTable.propTypes = {
nonExpandable: PropTypes.array,
showExpandColumn: PropTypes.bool,
onlyOneExpanding: PropTypes.bool,
expandByColumnOnly: PropTypes.bool,
expandColumnRenderer: PropTypes.func,
expandHeaderColumnRenderer: PropTypes.func
}),

View File

@ -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() {

View File

@ -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