Skip to content

Commit

Permalink
fix #1608
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Sep 13, 2017
1 parent f3466be commit 8ba60d8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,20 @@ class BootstrapTable extends Component {
}

if (this.isRemoteDataSource()) {
const newState = { sizePerPage, reset: false, currPage: page };
let data = nextProps.data.slice();
if (nextProps.pagination && !this.allowRemote(Const.REMOTE_PAGE)) {
data = this.store.page(page, sizePerPage).get();
}
this.setState(() => {
return {
data,
currPage: page,
sizePerPage,
reset: false
};
});

if (this.store.isOnFilter) {
if (this.store.searchText) this.handleSearch(this.store.searchText);
if (this.store.filterObj) this.handleFilterData(this.store.filterObj);
newState.currPage = Util.getFirstPage(nextProps.options.pageStartIndex);
} else {
newState.data = data;
}
this.setState(() => newState);
} else {
// #125
// remove !options.page for #709
Expand Down

0 comments on commit 8ba60d8

Please sign in to comment.