@@ -294,7 +294,7 @@ export default class Table extends React.Component {
294294 ) ;
295295 }
296296
297- getRowsByData ( data , visible , indent , columns , fixed ) {
297+ getRowsByData ( originalData , visible , indent , columns , fixed ) {
298298 const props = this . props ;
299299 const {
300300 childrenColumnName,
@@ -315,7 +315,10 @@ export default class Table extends React.Component {
315315
316316 const expandIconAsCell = fixed !== 'right' ? props . expandIconAsCell : false ;
317317 const expandIconColumnIndex = fixed !== 'right' ? props . expandIconColumnIndex : - 1 ;
318-
318+ let data = originalData ;
319+ if ( this . columnManager . isAnyColumnsFixed ( ) && data . length === 0 ) {
320+ data = [ { key : 'empty-placeholder-data' } ] ;
321+ }
319322 for ( let i = 0 ; i < data . length ; i ++ ) {
320323 const record = data [ i ] ;
321324 const key = this . getRowKey ( record , i ) ;
@@ -571,11 +574,17 @@ export default class Table extends React.Component {
571574
572575 getEmptyText ( ) {
573576 const { emptyText, prefixCls, data } = this . props ;
574- return ! data . length ? (
575- < div className = { `${ prefixCls } -placeholder` } key = "emptyText" >
577+ if ( data . length ) {
578+ return null ;
579+ }
580+ const fixed = this . columnManager . isAnyColumnsFixed ( ) ;
581+ const emptyClassName =
582+ `${ prefixCls } -placeholder${ fixed ? ` ${ prefixCls } -placeholder-fixed-columns` : '' } ` ;
583+ return (
584+ < div className = { emptyClassName } key = "emptyText" >
576585 { ( typeof emptyText === 'function' ) ? emptyText ( ) : emptyText }
577586 </ div >
578- ) : null ;
587+ ) ;
579588 }
580589
581590 getHeaderRowStyle ( columns , rows ) {
0 commit comments