This commit is contained in:
2025-05-22 16:39:48 +08:00
parent f3eb861ff4
commit 756392afc7
12 changed files with 699 additions and 561 deletions

View File

@@ -8524,6 +8524,7 @@ function shouldColor(rowIndex, cellIndex, row) {
return false;
}
function addRowIdToData(data) {
console.log('data at line 8526:', data)
let idCounter = 0; // Initialize an ID counter
// Iterate through each row
@@ -8537,11 +8538,13 @@ function addRowIdToData(data) {
const cell = data[i][j];
// If the cell has a rowspan attribute, propagate the same ID across all affected rows
if (cell.rowspan && cell.rowspan > 1) {
if (cell&&cell.text&&cell.rowspan && cell.rowspan > 1) {
for (let k = 0; k < cell.rowspan; k++) {
if (data[i + k]) {
// Ensure that all cells in the same column and across the rows have the same rowId
data[i + k][j].rowId = `row-${idCounter - 1}`;
data[i + k][j] ={...data[i + k][j],rowId:`row-${idCounter - 1}`} ;
}
}
}