Fix rowSelection.onChange selectedRows when specify rowKey

pull/1221/head
afc163 9 years ago
parent a9076945a9
commit 5e1f0960a2

@ -111,7 +111,9 @@ let AntTable = React.createClass({
}
if (this.props.rowSelection && this.props.rowSelection.onChange) {
const data = this.getCurrentPageData();
const selectedRows = data.filter(row => selectedRowKeys.indexOf(row.key) >= 0);
const selectedRows = data.filter(
(row, i) => selectedRowKeys.indexOf(this.getRecordKey(row, i)) >= 0
);
this.props.rowSelection.onChange(selectedRowKeys, selectedRows);
}
},

Loading…
Cancel
Save