Browse Source

Fix change visibility of multiple header with same index

Marc Fauvel 1 year ago
parent
commit
9effae0773
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/utils/index.js

+ 8 - 1
src/utils/index.js

@@ -300,7 +300,14 @@ export default {
           let colspan = 0
           let colspan = 0
 
 
           for (let i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
           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) {
             if (column.visible) {
               colspan++
               colspan++