File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class SelectRowHeaderColumn extends React.Component{
6
6
7
7
render ( ) {
8
8
var thStyle = {
9
- width : 35
9
+ width : parseInt ( this . props . width ) ? this . props . width : 35
10
10
} ;
11
11
12
12
return (
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ class TableHeader extends React.Component{
8
8
9
9
constructor ( props ) {
10
10
super ( props ) ;
11
+ this . selectRowColumnWidth = null ;
11
12
}
12
13
13
14
clearSortCaret ( order , sortField ) {
@@ -61,9 +62,9 @@ class TableHeader extends React.Component{
61
62
62
63
renderSelectRowHeader ( ) {
63
64
if ( this . props . rowSelectType == Const . ROW_SELECT_SINGLE ) {
64
- return ( < SelectRowHeaderColumn > </ SelectRowHeaderColumn > ) ;
65
+ return ( < SelectRowHeaderColumn width = { this . selectRowColumnWidth } > </ SelectRowHeaderColumn > ) ;
65
66
} else if ( this . props . rowSelectType == Const . ROW_SELECT_MULTI ) {
66
- return ( < SelectRowHeaderColumn >
67
+ return ( < SelectRowHeaderColumn width = { this . selectRowColumnWidth } >
67
68
< input type = "checkbox" onChange = { this . props . onSelectAllRow } checked = { this . props . isSelectAll } />
68
69
</ SelectRowHeaderColumn >
69
70
) ;
@@ -88,6 +89,8 @@ class TableHeader extends React.Component{
88
89
if ( Array . isArray ( this . props . children ) ) {
89
90
let startPosition = ( this . props . rowSelectType == Const . ROW_SELECT_SINGLE ||
90
91
this . props . rowSelectType == Const . ROW_SELECT_MULTI ) && ! this . props . hideSelectColumn ? 1 :0 ;
92
+ if ( startPosition == 1 )
93
+ this . selectRowColumnWidth = headerProps [ 0 ] . width ;
91
94
for ( let i = 0 ; i < this . props . children . length ; i ++ ) {
92
95
this . props . children [ i ] =
93
96
React . cloneElement ( this . props . children [ i ] , { width : headerProps [ i + startPosition ] . width + "px" } ) ;
You can’t perform that action at this time.
0 commit comments