Skip to content

Commit

Permalink
fix #1571
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Sep 12, 2017
1 parent 13f44ad commit 7960b3f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class TableHeaderColumn extends Component {
render() {
let defaultCaret;
let sortCaret;
let sortClass;
const {
headerText,
dataAlign,
Expand All @@ -122,6 +123,7 @@ class TableHeaderColumn extends Component {
className,
isOnlyHead,
version,
sortHeaderColumnClassName: customSortClass,
thStyle: style
} = this.props;
const thStyle = {
Expand All @@ -140,9 +142,14 @@ class TableHeaderColumn extends Component {
}
}

if (sort) {
sortClass = Util.isFunction(customSortClass) ?
customSortClass(sort, dataField) : customSortClass;
}
const classes = classSet(
Util.isFunction(className) ? className() : className,
!isOnlyHead && dataSort ? 'sort-column' : '');
!isOnlyHead && dataSort ? 'sort-column' : '',
sortClass);

const attr = {};
if (headerTitle) {
Expand Down Expand Up @@ -255,6 +262,7 @@ TableHeaderColumn.propTypes = {
width: PropTypes.string,
sortFunc: PropTypes.func,
sortFuncExtraData: PropTypes.any,
sortHeaderColumnClassName: PropTypes.any,
columnClassName: PropTypes.any,
editColumnClassName: PropTypes.any,
invalidEditColumnClassName: PropTypes.any,
Expand Down

0 comments on commit 7960b3f

Please sign in to comment.