diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index 171ecc6f7..15cdcdc0c 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -58,9 +58,15 @@ class BootstrapTable extends React.Component{ getTableData() { let result = []; if(this.props.pagination){ - result = this.store.page(this.props.options.page || 1, - this.props.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0]) - .get(); + let page, sizePerPage; + if(this.store.isChangedPage()){ + sizePerPage = this.refs.pagination.getSizePerPage(); + page = this.refs.pagination.getCurrentPage(); + } else { + sizePerPage = this.props.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0]; + page = this.props.options.page || 1; + } + result = this.store.page(page, sizePerPage).get(); } else{ result = this.store.get(); } diff --git a/src/store/TableDataStore.js b/src/store/TableDataStore.js index 44e440f06..4b36bb6ea 100644 --- a/src/store/TableDataStore.js +++ b/src/store/TableDataStore.js @@ -221,6 +221,10 @@ export class TableDataStore{ return this.getCurrentDisplayData().length; } + isChangedPage(){ + return this.pageObj.start && this.pageObj.end ? true: false; + } + getAllRowkey(){ return this.data.map(function(row){ return row[this.keyField];