@@ -148,11 +148,19 @@ class TableBody extends Component {
148148 this . props . expanding . indexOf ( key ) > - 1 ,
149149 ExpandColumnCustomComponent , r , data
150150 ) ;
151+ const haveExpandContent = this . props . expandableRow && this . props . expandableRow ( data ) ;
152+ const isExpanding = haveExpandContent && this . props . expanding . indexOf ( key ) > - 1 ;
153+
151154 // add by bluespring for className customize
152155 let trClassName = this . props . trClassName ;
153156 if ( isFun ( this . props . trClassName ) ) {
154157 trClassName = this . props . trClassName ( data , r ) ;
155158 }
159+ if ( isExpanding && this . props . expandParentClass ) {
160+ trClassName += isFun ( this . props . expandParentClass ) ?
161+ this . props . expandParentClass ( data , r ) :
162+ this . props . expandParentClass ;
163+ }
156164 const result = [ < TableRow isSelected = { selected } key = { key } className = { trClassName }
157165 index = { r }
158166 row = { data }
@@ -175,14 +183,17 @@ class TableBody extends Component {
175183 { tableColumns }
176184 </ TableRow > ] ;
177185
178- if ( this . props . expandableRow && this . props . expandableRow ( data ) ) {
186+ if ( haveExpandContent ) {
187+ const expandBodyClass = isFun ( this . props . expandBodyClass ) ?
188+ this . props . expandBodyClass ( data , r ) :
189+ this . props . expandBodyClass ;
179190 result . push (
180191 < ExpandComponent
181192 key = { key + '-expand' }
182193 row = { data }
183- className = { trClassName }
194+ className = { expandBodyClass }
184195 bgColor = { this . props . expandRowBgColor || this . props . selectRow . bgColor || undefined }
185- hidden = { ! ( this . props . expanding . indexOf ( key ) > - 1 ) }
196+ hidden = { ! isExpanding }
186197 colSpan = { expandColSpan }
187198 width = { "100%" } >
188199 { this . props . expandComponent ( data ) }
@@ -304,12 +315,13 @@ class TableBody extends Component {
304315 expandBy,
305316 expandableRow,
306317 selectRow : {
307- clickToExpand
318+ clickToExpand,
319+ hideSelectColumn
308320 } ,
309321 onlyOneExpanding
310322 } = this . props ;
311323 const selectRowAndExpand = this . _isSelectRowDefined ( ) && ! clickToExpand ? false : true ;
312- columnIndex = this . _isSelectRowDefined ( ) ? columnIndex - 1 : columnIndex ;
324+ columnIndex = this . _isSelectRowDefined ( ) && ! hideSelectColumn ? columnIndex - 1 : columnIndex ;
313325 columnIndex = this . _isExpandColumnVisible ( ) ? columnIndex - 1 : columnIndex ;
314326 if ( expandableRow &&
315327 selectRowAndExpand &&
@@ -503,6 +515,8 @@ TableBody.propTypes = {
503515 expandBy : PropTypes . string ,
504516 expanding : PropTypes . array ,
505517 onExpand : PropTypes . func ,
518+ expandBodyClass : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . func ] ) ,
519+ expandParentClass : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . func ] ) ,
506520 onlyOneExpanding : PropTypes . bool ,
507521 beforeShowError : PropTypes . func ,
508522 keyBoardNav : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . object ] ) ,
0 commit comments