mirror of
https://github.com/nasa/openmct.git
synced 2025-06-07 01:41:40 +00:00
cherry-pick #7863 83e4a124e2a6727651d82acd49eb1854b4f105ac
This commit is contained in:
parent
50e60e7824
commit
9cfbb966e2
@ -150,13 +150,13 @@ export default class TableRowCollection extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
insertOrUpdateRows(rowsToAdd, addToBeginning) {
|
insertOrUpdateRows(rowsToAdd, addToBeginning) {
|
||||||
rowsToAdd.forEach((row) => {
|
rowsToAdd.forEach((row, addRowsIndex) => {
|
||||||
const index = this.getInPlaceUpdateIndex(row);
|
const index = this.getInPlaceUpdateIndex(row);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
this.updateRowInPlace(row, index);
|
this.updateRowInPlace(row, index);
|
||||||
} else {
|
} else {
|
||||||
if (addToBeginning) {
|
if (addToBeginning) {
|
||||||
this.rows.unshift(row);
|
this.rows.splice(addRowsIndex, 0, row);
|
||||||
} else {
|
} else {
|
||||||
this.rows.push(row);
|
this.rows.push(row);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user