Skip to content

Commit

Permalink
fix #737
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Oct 1, 2016
1 parent 0fb4494 commit 35d9d1e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint default-case: 0 */
/* eslint guard-for-in: 0 */
import React, { Component, PropTypes } from 'react';
import classSet from 'classnames';
import Const from './Const';
import Util from './util';
import DateFilter from './filters/Date';
Expand Down Expand Up @@ -79,7 +80,8 @@ class TableHeaderColumn extends Component {
dataSort,
sortIndicator,
children,
caretRender
caretRender,
className
} = this.props;
const thStyle = {
textAlign: headerAlign || dataAlign,
Expand All @@ -101,8 +103,10 @@ class TableHeaderColumn extends Component {
if (caretRender) {
sortCaret = caretRender(sort);
}
const classes = classSet(
typeof className === 'function' ? className() : className,
dataSort ? 'sort-column' : '');

const classes = this.props.className + ' ' + (dataSort ? 'sort-column' : '');
const title = typeof children === 'string' ? { title: children } : null;
return (
<th ref='header-col'
Expand Down Expand Up @@ -193,7 +197,10 @@ TableHeaderColumn.propTypes = {
hidden: PropTypes.bool,
hiddenOnInsert: PropTypes.bool,
searchable: PropTypes.bool,
className: PropTypes.string,
className: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func
]),
width: PropTypes.string,
sortFunc: PropTypes.func,
sortFuncExtraData: PropTypes.any,
Expand Down

0 comments on commit 35d9d1e

Please sign in to comment.