From 69233b8e6eadc2943456a54f534ad5a9b9abb5e6 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Wed, 11 Nov 2015 00:00:09 +0800 Subject: [PATCH] init pagination if data change --- src/BootstrapTable.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index f3061f80a..514808b76 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -84,6 +84,8 @@ class BootstrapTable extends React.Component { componentWillReceiveProps(nextProps) { if (Array.isArray(nextProps.data)) { this.store.setData(nextProps.data); + this.store.page(this.props.options.page || 1, + this.props.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0]); this.setState({ data: this.getTableData() });