Skip to content

Commit 7960b3f

Browse files
committed
fix #1571
1 parent 13f44ad commit 7960b3f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/TableHeaderColumn.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class TableHeaderColumn extends Component {
107107
render() {
108108
let defaultCaret;
109109
let sortCaret;
110+
let sortClass;
110111
const {
111112
headerText,
112113
dataAlign,
@@ -122,6 +123,7 @@ class TableHeaderColumn extends Component {
122123
className,
123124
isOnlyHead,
124125
version,
126+
sortHeaderColumnClassName: customSortClass,
125127
thStyle: style
126128
} = this.props;
127129
const thStyle = {
@@ -140,9 +142,14 @@ class TableHeaderColumn extends Component {
140142
}
141143
}
142144

145+
if (sort) {
146+
sortClass = Util.isFunction(customSortClass) ?
147+
customSortClass(sort, dataField) : customSortClass;
148+
}
143149
const classes = classSet(
144150
Util.isFunction(className) ? className() : className,
145-
!isOnlyHead && dataSort ? 'sort-column' : '');
151+
!isOnlyHead && dataSort ? 'sort-column' : '',
152+
sortClass);
146153

147154
const attr = {};
148155
if (headerTitle) {
@@ -255,6 +262,7 @@ TableHeaderColumn.propTypes = {
255262
width: PropTypes.string,
256263
sortFunc: PropTypes.func,
257264
sortFuncExtraData: PropTypes.any,
265+
sortHeaderColumnClassName: PropTypes.any,
258266
columnClassName: PropTypes.any,
259267
editColumnClassName: PropTypes.any,
260268
invalidEditColumnClassName: PropTypes.any,

0 commit comments

Comments
 (0)