diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index 77804fd61..b340f0a76 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -220,6 +220,7 @@ class BootstrapTable extends React.Component { selectedRowKeys={this.state.selectedRowKeys} onRowClick={this.handleRowClick.bind(this)} onSelectRow={this.handleSelectRow.bind(this)} + noDataText={this.props.options.noDataText} /> {tableFilter} @@ -618,7 +619,8 @@ BootstrapTable.propTypes = { paginationSize: React.PropTypes.number, onSortChange: React.PropTypes.func, onPageChange: React.PropTypes.func, - onSizePerPageList: React.PropTypes.func + onSizePerPageList: React.PropTypes.func, + noDataText: React.PropTypes.string }), fetchInfo: React.PropTypes.shape({ dataTotalSize: React.PropTypes.number, @@ -668,7 +670,8 @@ BootstrapTable.defaultProps = { sizePerPageList: Const.SIZE_PER_PAGE_LIST, sizePerPage: undefined, paginationSize: Const.PAGINATION_SIZE, - onSizePerPageList: undefined + onSizePerPageList: undefined, + noDataText: undefined }, fetchInfo: { dataTotalSize: 0, diff --git a/src/Const.js b/src/Const.js index bd57a50ee..ea8935162 100644 --- a/src/Const.js +++ b/src/Const.js @@ -14,5 +14,6 @@ export default { CELL_EDIT_CLICK: "click", CELL_EDIT_DBCLICK: "dbclick", SIZE_PER_PAGE_LIST: [10, 25, 30, 50], - PAGINATION_SIZE: 5 + PAGINATION_SIZE: 5, + NO_DATA_TEXT: "There is no data to display" } diff --git a/src/TableBody.js b/src/TableBody.js index 94aa33dc1..bf19048cd 100644 --- a/src/TableBody.js +++ b/src/TableBody.js @@ -122,7 +122,7 @@ class TableBody extends React.Component{ - There is no data to display + {this.props.noDataText||Const.NO_DATA_TEXT} ); } @@ -286,6 +286,7 @@ TableBody.propTypes = { keyField: React.PropTypes.string, selectedRowKeys: React.PropTypes.array, onRowClick: React.PropTypes.func, - onSelectRow: React.PropTypes.func + onSelectRow: React.PropTypes.func, + noDataText: React.PropTypes.string }; export default TableBody;