File tree 3 files changed +11
-10
lines changed
3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,11 @@ class TableBody extends React.Component{
154
154
selectRowHeader = this . props . selectRow . hideSelectColumn ?null :( < th style = { style } key = { - 1 } > </ th > ) ;
155
155
}
156
156
var theader = this . props . columns . map ( function ( column , i ) {
157
+ let width = parseInt ( column . width ) ;
157
158
let style = {
158
159
display : column . hidden ?"none" :null ,
159
- width : column . width ,
160
- maxWidth : column . width
160
+ width : width ,
161
+ maxWidth : width
161
162
/** add min-wdth to fix user assign column width not eq offsetWidth in large column table **/
162
163
} ;
163
164
let sortCaert = column . sort ?( Util . renderReactSortCaret ( Const . SORT_DESC ) ) :null ;
Original file line number Diff line number Diff line change @@ -22,17 +22,16 @@ class TableColumn extends React.Component{
22
22
}
23
23
24
24
render ( ) {
25
+ var width = parseInt ( this . props . width ) ;
25
26
var tdStyle = {
26
27
textAlign : this . props . dataAlign ,
27
28
display : this . props . hidden ?"none" :null ,
28
- width : this . props . width ,
29
- maxWidth : this . props . width
29
+ width : width ,
30
+ maxWidth : width
30
31
} ;
31
32
var classname = this . props . className ;
32
- if ( this . props . width &&
33
- this . props . width !== null && this . props . width . indexOf ( 'px' ) > - 1 ) {
34
- let w = this . props . width . replace ( 'px' , '' ) ;
35
- classname += " col-md-" + w ;
33
+ if ( this . props . width ) {
34
+ classname += " col-md-" + width ;
36
35
}
37
36
38
37
Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ class TableHeaderColumn extends React.Component{
20
20
}
21
21
22
22
render ( ) {
23
+ var width = this . props . width !== null ?parseInt ( this . props . width ) :null ;
23
24
var thStyle = {
24
25
textAlign : this . props . dataAlign ,
25
26
display : this . props . hidden ?"none" :null ,
26
- width : this . props . width ,
27
- maxWidth : this . props . width
27
+ width : width ,
28
+ maxWidth : width
28
29
} ;
29
30
30
31
var classes = this . props . className + " " + ( this . props . dataSort ?"sort-column" :"" ) ;
You can’t perform that action at this time.
0 commit comments