Skip to content

Commit

Permalink
Merge pull request #228 from frontsideair/pagination2
Browse files Browse the repository at this point in the history
Fix pagination lost bug
  • Loading branch information
AllenFang committed Jan 24, 2016
2 parents d8c7dc8 + 4c44c2a commit 6fe1812
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ class BootstrapTable extends React.Component {
if (Array.isArray(nextProps.data)) {
this.store.setData(nextProps.data);
let paginationDom = this.refs.pagination;
let page = nextProps.options.page ||
(paginationDom ? paginationDom.getCurrentPage() : 1);
let sizePerPage = nextProps.options.sizePerPage ||
(paginationDom ? paginationDom.getSizePerPage() : Const.SIZE_PER_PAGE_LIST[0]);
let page = paginationDom && paginationDom.getCurrentPage() || nextProps.options.page || 1;
let sizePerPage = paginationDom && paginationDom.getSizePerPage() || nextProps.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0];
// #125
if(page > Math.ceil(nextProps.data.length / sizePerPage)) page = 1;
let sortInfo = this.store.getSortInfo();
Expand Down

0 comments on commit 6fe1812

Please sign in to comment.