Fix rowSelection.onChange selectedRows when specify rowKey

This commit is contained in:
afc163 2016-03-16 16:03:16 +08:00
parent a9076945a9
commit 5e1f0960a2

View File

@ -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);
}
},