mirror of https://github.com/ElemeFE/element
pull/13257/head
parent
bc26ab6ba5
commit
0d526b8371
|
@ -597,6 +597,20 @@ TableStore.prototype.updateCurrentRow = function() {
|
||||||
const oldCurrentRow = states.currentRow;
|
const oldCurrentRow = states.currentRow;
|
||||||
|
|
||||||
if (data.indexOf(oldCurrentRow) === -1) {
|
if (data.indexOf(oldCurrentRow) === -1) {
|
||||||
|
if (states.rowKey && oldCurrentRow) {
|
||||||
|
let newCurrentRow = null;
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const item = data[i];
|
||||||
|
if (item && item[states.rowKey] === oldCurrentRow[states.rowKey]) {
|
||||||
|
newCurrentRow = item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (newCurrentRow) {
|
||||||
|
states.currentRow = newCurrentRow;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
states.currentRow = null;
|
states.currentRow = null;
|
||||||
|
|
||||||
if (states.currentRow !== oldCurrentRow) {
|
if (states.currentRow !== oldCurrentRow) {
|
||||||
|
|
Loading…
Reference in New Issue