Skip to content

Commit

Permalink
Merge pull request #1082 from dp-huang/master
Browse files Browse the repository at this point in the history
fix an exception if table source data is immutable type
  • Loading branch information
AllenFang authored Mar 10, 2017
2 parents 6855c9a + abf6612 commit 70de237
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,19 @@ class TableBody extends Component {
}
return (result);
}, this);

let tableRowsOutput = tableRows;

if (tableRows.length === 0 && !this.props.withoutNoDataText) {
tableRows.push(
tableRowsOutput = [
<TableRow key='##table-empty##'>
<td data-toggle='collapse'
colSpan={ this.props.columns.length + (isSelectRowDefined ? 1 : 0) }
className='react-bs-table-no-data'>
{ this.props.noDataText || Const.NO_DATA_TEXT }
</td>
</TableRow>
);
];
}

return (
Expand All @@ -206,7 +209,7 @@ class TableBody extends Component {
<table className={ tableClasses }>
{ React.cloneElement(tableHeader, { ref: 'header' }) }
<tbody ref='tbody'>
{ tableRows }
{ tableRowsOutput }
</tbody>
</table>
</div>
Expand Down

0 comments on commit 70de237

Please sign in to comment.