Compare commits
No commits in common. "95f9e1a0d96c13bc68675158317d3e10a57a1a62" and "b4139cd66af78e75b56287f8ca23768e707933c6" have entirely different histories.
95f9e1a0d9
...
b4139cd66a
@ -1,5 +1,3 @@
|
|||||||
import { getDataRowId } from "./rowUtils";
|
|
||||||
|
|
||||||
export function setNewValueToData(data, colId, rowId, value) {
|
export function setNewValueToData(data, colId, rowId, value) {
|
||||||
let targetObject = data;
|
let targetObject = data;
|
||||||
if (rowId && rowId.length) {
|
if (rowId && rowId.length) {
|
||||||
@ -169,9 +167,8 @@ export function deleteRow(data, lineId) {
|
|||||||
function findAndDelete(rows) {
|
function findAndDelete(rows) {
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
const row = rows[i];
|
const row = rows[i];
|
||||||
const rowId = getDataRowId(row.data);
|
|
||||||
|
|
||||||
if (rowId == lineId) {
|
if (row.data.line_id == lineId) {
|
||||||
rowDeleteSortOrder = row.sort_order;
|
rowDeleteSortOrder = row.sort_order;
|
||||||
rows.splice(i, 1);
|
rows.splice(i, 1);
|
||||||
i--;
|
i--;
|
||||||
@ -182,7 +179,7 @@ export function deleteRow(data, lineId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (row.subRows && Array.isArray(row.subRows) && row.subRows.length > 0) {
|
if (row.subRows && Array.isArray(row.subRows) && row.subRows.length > 0) {
|
||||||
findAndDelete(row.subRows);
|
const found = findAndDelete(row.subRows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
export function getDataRowId(data) {
|
|
||||||
return data?.id || data?.line_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getRowId(row) {
|
export function getRowId(row) {
|
||||||
return getDataRowId(row.original.data);
|
return row.original.data.id || row.original.data.line_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isVspRow(row) {
|
export function isVspRow(row) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user