Skip to content

Commit edd5581

Browse files
committed
fix #526
1 parent aa1db57 commit edd5581

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/BootstrapTable.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ class BootstrapTable extends Component {
3636
const copy = this.props.selectRow.selected.slice();
3737
this.store.setSelectedRowKey(copy);
3838
}
39+
let currPage = Const.PAGE_START_INDEX;
40+
if (typeof this.props.options.page !== 'undefined') {
41+
currPage = this.props.options.page;
42+
} else if (typeof this.props.options.pageStartIndex !== 'undefined') {
43+
currPage = this.props.options.pageStartIndex;
44+
}
3945

4046
this.state = {
4147
data: this.getTableData(),
42-
currPage: this.props.options.page ||
43-
this.props.options.pageStartIndex ||
44-
Const.PAGE_START_INDEX,
48+
currPage: currPage,
4549
sizePerPage: this.props.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0],
4650
selectedRowKeys: this.store.getSelectedRowKeys()
4751
};

0 commit comments

Comments
 (0)