File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ class TableHeaderColumn extends Component {
25
25
26
26
handleColumnClick = ( ) => {
27
27
if ( this . props . isOnlyHead || ! this . props . dataSort ) return ;
28
- const order = this . props . sort === Const . SORT_DESC ? Const . SORT_ASC : Const . SORT_DESC ;
28
+ let { sort : order } = this . props ;
29
+ if ( ! order && this . props . defaultASC ) order = Const . SORT_ASC ;
30
+ else order = this . props . sort === Const . SORT_DESC ? Const . SORT_ASC : Const . SORT_DESC ;
29
31
this . props . onSort ( order , this . props . dataField ) ;
30
32
}
31
33
@@ -270,7 +272,8 @@ TableHeaderColumn.propTypes = {
270
272
tdAttr : PropTypes . object ,
271
273
tdStyle : PropTypes . object ,
272
274
thStyle : PropTypes . object ,
273
- keyValidator : PropTypes . bool
275
+ keyValidator : PropTypes . bool ,
276
+ defaultASC : PropTypes . bool
274
277
} ;
275
278
276
279
TableHeaderColumn . defaultProps = {
@@ -305,7 +308,8 @@ TableHeaderColumn.defaultProps = {
305
308
tdAttr : undefined ,
306
309
tdStyle : undefined ,
307
310
thStyle : undefined ,
308
- keyValidator : false
311
+ keyValidator : false ,
312
+ defaultASC : false
309
313
} ;
310
314
311
315
export default TableHeaderColumn ;
You can’t perform that action at this time.
0 commit comments