Skip to content

Commit

Permalink
fix #414
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Apr 25, 2016
1 parent 6650629 commit e60e607
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,14 @@ class BootstrapTable extends Component {
let sortIndicator = this.props.options.sortIndicator;
if (typeof this.props.options.sortIndicator === 'undefined') sortIndicator = true;
return (
<div className='react-bs-table-container'>
<div className='react-bs-table-container' style={ this.props.containerStyle }>
{ toolBar }
<div className='react-bs-table' ref='table' style={ style }
<div className='react-bs-table' ref='table' style={ { ...style, ...this.props.tableStyle } }
onMouseEnter={ this.handleMouseEnter }
onMouseLeave={ this.handleMouseLeave }>
<TableHeader
ref='header'
style={ this.props.headerStyle }
rowSelectType={ this.props.selectRow.mode }
hideSelectColumn={ this.props.selectRow.hideSelectColumn }
sortName={ sortInfo ? sortInfo.sortField : undefined }
Expand All @@ -247,7 +248,7 @@ class BootstrapTable extends Component {
{ this.props.children }
</TableHeader>
<TableBody ref='body'
style={ style }
style={ { ...style, ...this.props.bodyStyle } }
data={ this.state.data }
columns={ columns }
trClassName={ this.props.trClassName }
Expand Down Expand Up @@ -793,6 +794,10 @@ BootstrapTable.propTypes = {
search: PropTypes.bool,
columnFilter: PropTypes.bool,
trClassName: PropTypes.any,
tableStyle: PropTypes.object,
containerStyle: PropTypes.object,
headerStyle: PropTypes.object,
bodyStyle: PropTypes.object,
options: PropTypes.shape({
clearSearch: PropTypes.bool,
sortName: PropTypes.string,
Expand Down Expand Up @@ -862,6 +867,10 @@ BootstrapTable.defaultProps = {
multiColumnSearch: false,
columnFilter: false,
trClassName: '',
tableStyle: undefined,
containerStyle: undefined,
headerStyle: undefined,
bodyStyle: undefined,
options: {
clearSearch: false,
sortName: undefined,
Expand Down
3 changes: 2 additions & 1 deletion src/TableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TableHeader extends Component {
this._attachClearSortCaretFunc();

return (
<div ref='container' className={ containerClasses }>
<div ref='container' className={ containerClasses } style={ this.props.style }>
<table className={ tableClasses }>
<thead>
<tr ref='header'>
Expand Down Expand Up @@ -82,6 +82,7 @@ class TableHeader extends Component {
}
}
TableHeader.propTypes = {
style: PropTypes.object,
rowSelectType: PropTypes.string,
onSort: PropTypes.func,
onSelectAllRow: PropTypes.func,
Expand Down

0 comments on commit e60e607

Please sign in to comment.