Skip to content

Commit

Permalink
fix #1417
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Jun 24, 2017
1 parent b6da50e commit 2cf11ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
19 changes: 19 additions & 0 deletions src/ExpandRowHeaderColumn.js
@@ -0,0 +1,19 @@
import React, { Component, PropTypes } from 'react';

class ExpandRowHeaderColumn extends Component {

render() {
return (
<th rowSpan={ this.props.rowCount } style={ { textAlign: 'center' } }
className='react-bs-table-expand-cell'
data-is-only-head={ false }>
{ this.props.children }
</th>
);
}
}
ExpandRowHeaderColumn.propTypes = {
children: PropTypes.node,
rowCount: PropTypes.number
};
export default ExpandRowHeaderColumn;
5 changes: 3 additions & 2 deletions src/TableHeader.js
Expand Up @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom';
import Const from './Const';
import classSet from 'classnames';
import SelectRowHeaderColumn from './SelectRowHeaderColumn';
import ExpandRowHeaderColumn from './ExpandRowHeaderColumn';

class Checkbox extends Component {
componentDidMount() { this.update(this.props.checked); }
Expand Down Expand Up @@ -55,13 +56,13 @@ class TableHeader extends Component {
rows[0].push( [
this.props.expandColumnVisible &&
this.props.expandColumnBeforeSelectColumn &&
<th className='react-bs-table-expand-cell'> </th>
<ExpandRowHeaderColumn rowCount={ rowCount + 1 }/>
], [
this.renderSelectRowHeader(rowCount + 1, rowKey++)
], [
this.props.expandColumnVisible &&
!this.props.expandColumnBeforeSelectColumn &&
<th className='react-bs-table-expand-cell'> </th>
<ExpandRowHeaderColumn rowCount={ rowCount + 1 }/>
]);
const { sortIndicator, sortList, onSort, reset } = this.props;

Expand Down

0 comments on commit 2cf11ec

Please sign in to comment.