From 2cf11ec951089ff6452c0a97ee0613fc113103c5 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sat, 24 Jun 2017 15:46:55 +0800 Subject: [PATCH] fix #1417 --- src/ExpandRowHeaderColumn.js | 19 +++++++++++++++++++ src/TableHeader.js | 5 +++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/ExpandRowHeaderColumn.js diff --git a/src/ExpandRowHeaderColumn.js b/src/ExpandRowHeaderColumn.js new file mode 100644 index 000000000..57f3d6cc9 --- /dev/null +++ b/src/ExpandRowHeaderColumn.js @@ -0,0 +1,19 @@ +import React, { Component, PropTypes } from 'react'; + +class ExpandRowHeaderColumn extends Component { + + render() { + return ( + + { this.props.children } + + ); + } +} +ExpandRowHeaderColumn.propTypes = { + children: PropTypes.node, + rowCount: PropTypes.number +}; +export default ExpandRowHeaderColumn; diff --git a/src/TableHeader.js b/src/TableHeader.js index 874bd169b..39b413c6c 100644 --- a/src/TableHeader.js +++ b/src/TableHeader.js @@ -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); } @@ -55,13 +56,13 @@ class TableHeader extends Component { rows[0].push( [ this.props.expandColumnVisible && this.props.expandColumnBeforeSelectColumn && - + ], [ this.renderSelectRowHeader(rowCount + 1, rowKey++) ], [ this.props.expandColumnVisible && !this.props.expandColumnBeforeSelectColumn && - + ]); const { sortIndicator, sortList, onSort, reset } = this.props;