simplify add all method
This commit is contained in:
parent
dffdcd882f
commit
8531b9fd40
|
@ -222,15 +222,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
let rowsToAdd = []
|
selectedRows = [...selectedRows, ...rows]
|
||||||
rows.map(x =>
|
|
||||||
selectedRows
|
|
||||||
.map(y => rows.map(x => x._id).indexOf(y._id))
|
|
||||||
.includes(true)
|
|
||||||
? null
|
|
||||||
: rowsToAdd.push(x)
|
|
||||||
)
|
|
||||||
selectedRows = [...selectedRows, ...rowsToAdd]
|
|
||||||
} else {
|
} else {
|
||||||
//remove every object from selectedRows that is not in rows
|
//remove every object from selectedRows that is not in rows
|
||||||
let filtered = selectedRows.filter(el =>
|
let filtered = selectedRows.filter(el =>
|
||||||
|
|
Loading…
Reference in New Issue