Skip to content

Commit

Permalink
init pagination if data change
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Nov 10, 2015
1 parent 6565ce1 commit 69233b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class BootstrapTable extends React.Component {
componentWillReceiveProps(nextProps) {
if (Array.isArray(nextProps.data)) {
this.store.setData(nextProps.data);
this.store.page(this.props.options.page || 1,
this.props.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0]);
this.setState({
data: this.getTableData()
});
Expand Down

0 comments on commit 69233b8

Please sign in to comment.