From 9effae07735cd1b276df761120f8170e5b19a250 Mon Sep 17 00:00:00 2001 From: Marc Fauvel Date: Thu, 7 Mar 2024 10:48:59 +0100 Subject: [PATCH 1/3] Fix change visibility of multiple header with same index --- src/utils/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/index.js b/src/utils/index.js index 9b50f3dbfd..dc64b0c04e 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -300,7 +300,14 @@ export default { let colspan = 0 for (let i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) { - const column = allColumns.find(col => col.fieldIndex === i) + let underColumns = allColumns.filter(col => col.fieldIndex === i) + const column = underColumns[underColumns.length - 1] + + if(underColumns.length > 1){ + for(let j = 0; j < underColumns.length - 1; j++){ + underColumns[j].visible = column.visible + } + } if (column.visible) { colspan++ From 5bb2ea50216d913665e9f9733c71167d52b4d1a9 Mon Sep 17 00:00:00 2001 From: Marc Fauvel Date: Thu, 7 Mar 2024 11:45:02 +0100 Subject: [PATCH 2/3] Fix lint --- src/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/index.js b/src/utils/index.js index dc64b0c04e..812d8a2378 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -300,7 +300,7 @@ export default { let colspan = 0 for (let i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) { - let underColumns = allColumns.filter(col => col.fieldIndex === i) + const underColumns = allColumns.filter(col => col.fieldIndex === i) const column = underColumns[underColumns.length - 1] if(underColumns.length > 1){ From 3da31acf2aab30ef32f3cbb2b2b5ade7313939e7 Mon Sep 17 00:00:00 2001 From: Marc Fauvel Date: Thu, 7 Mar 2024 11:48:18 +0100 Subject: [PATCH 3/3] Fix lint 2 --- src/utils/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index 812d8a2378..e5ce756aed 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -303,8 +303,8 @@ export default { const underColumns = allColumns.filter(col => col.fieldIndex === i) const column = underColumns[underColumns.length - 1] - if(underColumns.length > 1){ - for(let j = 0; j < underColumns.length - 1; j++){ + if (underColumns.length > 1) { + for (let j = 0; j < underColumns.length - 1; j++) { underColumns[j].visible = column.visible } }