From 3157dbe44cc4681233d7ca86b8f8987ea886579f Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sun, 24 Jan 2016 15:52:06 +0800 Subject: [PATCH] fix #210 --- src/BootstrapTable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index 27c6ec9f6..fb76faf02 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -26,7 +26,8 @@ class BootstrapTable extends React.Component { }) }); } else { - this.store = new TableDataStore(this.props.data); + let copy = this.props.data.slice(); + this.store = new TableDataStore(copy); } this.initTable(this.props); @@ -117,7 +118,7 @@ class BootstrapTable extends React.Component { componentWillReceiveProps(nextProps) { this.initTable(nextProps); if (Array.isArray(nextProps.data)) { - this.store.setData(nextProps.data); + this.store.setData(nextProps.data.slice()); let paginationDom = this.refs.pagination; let page = paginationDom && paginationDom.getCurrentPage() || nextProps.options.page || 1; let sizePerPage = paginationDom && paginationDom.getSizePerPage() || nextProps.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0];