Skip to content

Commit

Permalink
fix #210
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Jan 24, 2016
1 parent d0d78ef commit 3157dbe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 3157dbe

Please sign in to comment.