Skip to content

Commit e219cef

Browse files
committed
fix bug for disable remote pagination(remote altervative)
1 parent abe1937 commit e219cef

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/BootstrapTable.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class BootstrapTable extends Component {
9696
colInfos: this.colInfos,
9797
multiColumnSearch: props.multiColumnSearch,
9898
multiColumnSort: props.multiColumnSort,
99-
remote: this.isRemoteDataSource()
99+
remote: this.props.remote
100100
});
101101
}
102102

@@ -203,8 +203,12 @@ class BootstrapTable extends Component {
203203
}
204204

205205
if (this.isRemoteDataSource()) {
206+
let data = nextProps.data.slice();
207+
if (nextProps.pagination && !this.allowRemote(Const.REMOTE_PAGE)) {
208+
data = this.store.page(page, sizePerPage).get();
209+
}
206210
this.setState({
207-
data: nextProps.data.slice(),
211+
data,
208212
currPage: page,
209213
sizePerPage,
210214
reset: false

src/store/TableDataStore.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,10 @@ export class TableDataStore {
599599

600600
if (_data.length === 0) return _data;
601601

602-
if (this.remote || !this.enablePagination) {
602+
const remote = typeof this.remote === 'function' ?
603+
(this.remote(Const.REMOTE))[Const.REMOTE_PAGE] : this.remote;
604+
605+
if (remote || !this.enablePagination) {
603606
return _data;
604607
} else {
605608
const result = [];

0 commit comments

Comments
 (0)