Skip to content

Commit

Permalink
fix variable reference issue for default selected
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Feb 5, 2016
1 parent d860fa6 commit 13f736c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class BootstrapTable extends React.Component {
this.initTable(this.props);

if (this.props.selectRow && this.props.selectRow.selected) {
this.store.setSelectedRowKey(this.props.selectRow.selected);
let copy = this.props.selectRow.selected.slice();
this.store.setSelectedRowKey(copy);
}

this.state = {
Expand Down Expand Up @@ -136,9 +137,10 @@ class BootstrapTable extends React.Component {
}
if (nextProps.selectRow && nextProps.selectRow.selected) {
//set default select rows to store.
this.store.setSelectedRowKey(nextProps.selectRow.selected);
let copy = nextProps.selectRow.selected.slice();
this.store.setSelectedRowKey(copy);
this.setState({
selectedRowKeys: nextProps.selectRow.selected
selectedRowKeys: copy
});
}
}
Expand Down

0 comments on commit 13f736c

Please sign in to comment.