Skip to content

Commit ff7bb16

Browse files
youlunalakerswgq
authored andcommitted
fix(Table): virtual table with selection should tell all records, fix alibaba-fusion#3792
1 parent f5d23e2 commit ff7bb16

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/table/selection.jsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export default function selection(BaseComponent) {
250250
selectOneRow(index, record, checked, e) {
251251
let selectedRowKeys = [...this.state.selectedRowKeys],
252252
i;
253-
const { primaryKey, rowSelection, dataSource } = this.props,
253+
const { primaryKey, rowSelection, dataSource, entireDataSource } = this.props,
254254
mode = rowSelection.mode ? rowSelection.mode : 'multiple',
255255
id = record[primaryKey];
256256
if (!id) {
@@ -266,10 +266,11 @@ export default function selection(BaseComponent) {
266266
} else if (checked) {
267267
selectedRowKeys = [id];
268268
}
269-
const records = unique(
270-
dataSource.filter(item => selectedRowKeys.indexOf(item[primaryKey]) > -1),
271-
primaryKey
272-
);
269+
let totalDS = dataSource;
270+
if (Array.isArray(entireDataSource) && entireDataSource.length > dataSource.length) {
271+
totalDS = entireDataSource;
272+
}
273+
const records = unique(totalDS.filter(item => selectedRowKeys.indexOf(item[primaryKey]) > -1), primaryKey);
273274
if (typeof rowSelection.onSelect === 'function') {
274275
rowSelection.onSelect(checked, record, records);
275276
}

0 commit comments

Comments
 (0)