Skip to content

Commit

Permalink
fix #186
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Dec 19, 2015
1 parent 1d57c6d commit d4e16e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
</div>
{tableFilter}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/Const.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
5 changes: 3 additions & 2 deletions src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class TableBody extends React.Component{
<TableRow key="##table-empty##">
<td colSpan={this.props.columns.length+(isSelectRowDefined?1:0)}
style={{ textAlign: "center" }}>
There is no data to display
{this.props.noDataText||Const.NO_DATA_TEXT}
</td>
</TableRow>);
}
Expand Down Expand Up @@ -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;

0 comments on commit d4e16e7

Please sign in to comment.