diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index dbfa5ad9a..9cad5fb67 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -425,6 +425,7 @@ class BootstrapTable extends Component { tableBodyClass={ this.props.tableBodyClass } style={ { ...style, ...this.props.bodyStyle } } data={ this.state.data } + defaultValue={ this.props.defaultValue } expandComponent={ this.props.expandComponent } expandableRow={ this.props.expandableRow } expandRowBgColor={ this.props.options.expandRowBgColor } @@ -1426,6 +1427,7 @@ BootstrapTable.propTypes = { height: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), maxHeight: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), data: PropTypes.oneOfType([ PropTypes.array, PropTypes.object ]), + defaultValue: PropTypes.string, remote: PropTypes.oneOfType([ PropTypes.bool, PropTypes.func ]), // remote data, default is false replace: PropTypes.oneOfType([ PropTypes.bool, PropTypes.func ]), scrollTop: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), diff --git a/src/TableBody.js b/src/TableBody.js index 8f5779f89..b4ba463df 100644 --- a/src/TableBody.js +++ b/src/TableBody.js @@ -109,6 +109,7 @@ class TableBody extends Component { } else { columnTitle = column.columnTitle && fieldValue ? fieldValue.toString() : null; } + if (!columnChild) { columnChild = this.props.defaultValue; } return (