bugfix:展开行问题

This commit is contained in:
kvkens 2018-10-24 15:14:27 +08:00
parent bdb83ec285
commit 994702efc3
2 changed files with 4 additions and 4 deletions

View File

@ -304,7 +304,7 @@ var Table = function (_Component) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
var info = this.findExpandedRow(record); var info = this.findExpandedRow(record, index);
if (typeof info !== 'undefined' && !expanded) { if (typeof info !== 'undefined' && !expanded) {
this.onRowDestroy(record, index); this.onRowDestroy(record, index);
} else if (!info && expanded) { } else if (!info && expanded) {
@ -923,7 +923,7 @@ var Table = function (_Component) {
//const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index)); //const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index));
//修复rowKey index问题 By Kvkens 2018-10-24 13:38:38 //修复rowKey index问题 By Kvkens 2018-10-24 13:38:38
var rows = this.getExpandedRows().filter(function (item, i) { var rows = this.getExpandedRows().filter(function (item, i) {
i === _this4.getRowKey(record, index) || item === _this4.getRowKey(record, index); return i === _this4.getRowKey(record, index) || item === _this4.getRowKey(record, index);
}); });
return rows[0]; return rows[0];
}; };

View File

@ -228,7 +228,7 @@ class Table extends Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
const info = this.findExpandedRow(record); const info = this.findExpandedRow(record, index);
if (typeof info !== 'undefined' && !expanded) { if (typeof info !== 'undefined' && !expanded) {
this.onRowDestroy(record, index); this.onRowDestroy(record, index);
} else if (!info && expanded) { } else if (!info && expanded) {
@ -806,7 +806,7 @@ class Table extends Component {
//const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index)); //const rows = this.getExpandedRows().filter(i => i === this.getRowKey(record, index));
//修复rowKey index问题 By Kvkens 2018-10-24 13:38:38 //修复rowKey index问题 By Kvkens 2018-10-24 13:38:38
const rows = this.getExpandedRows().filter((item, i) => { const rows = this.getExpandedRows().filter((item, i) => {
i === this.getRowKey(record, index) || item === this.getRowKey(record, index) return i === this.getRowKey(record, index) || item === this.getRowKey(record, index)
}); });
return rows[0]; return rows[0];
} }