File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
projects/igniteui-angular/src/lib/grids/pivot-grid Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 173
173
[ngStyle] ="column.headerGroupStyles |igxHeaderGroupStyle:column:grid.pipeTrigger " [column] ="column "
174
174
[style.min-width] ="column.calcWidth | igxHeaderGroupWidth:grid.defaultHeaderGroupMinWidth:hasMRL "
175
175
[style.flex-basis] ="column.calcWidth | igxHeaderGroupWidth:grid.defaultHeaderGroupMinWidth:hasMRL "
176
- (pointerdown) ="grid.navigation.focusOutRowHeader($event) ">
176
+ (pointerdown) ="grid.navigation.focusOutRowHeader($event) "
177
+ [style.visibility] ='getVisibility(column, dimLevelColumns) '>
177
178
</ igx-grid-header-group >
178
179
</ ng-template >
179
180
</ div >
Original file line number Diff line number Diff line change @@ -98,6 +98,14 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent implem
98
98
return ! col . columnGroup && col . level < this . totalDepth ? ( this . totalDepth - col . level ) * this . grid . rowHeight : this . grid . rowHeight ;
99
99
}
100
100
101
+ public getVisibility ( col : ColumnType , collection : ColumnType [ ] ) {
102
+ const lvl = this . columnDimensionsByLevel . indexOf ( collection )
103
+ const parentCollection = lvl > 0 ? this . columnDimensionsByLevel [ lvl - 1 ] : [ ] ;
104
+ const duplicate = parentCollection . indexOf ( col ) !== - 1 ;
105
+
106
+ return duplicate ? 'hidden' : 'visible' ;
107
+ }
108
+
101
109
102
110
public populateColumnDimensionsByLevel ( ) {
103
111
const res = [ ] ;
@@ -106,11 +114,15 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent implem
106
114
this . columnDimensionsByLevel = res ;
107
115
return ;
108
116
}
117
+ let prev = [ ] ;
109
118
const cols = this . unpinnedColumnCollection ;
110
119
for ( let i = 0 ; i < this . totalDepth ; i ++ ) {
111
120
const lvl = i ;
112
- const colsForLevel = cols . filter ( x => x . level === lvl ) ;
121
+ let colsForLevel = cols . filter ( x => x . level === lvl ) ;
122
+ const prevChildless = prev . filter ( x => ! x . columnGroup ) ;
123
+ colsForLevel = colsForLevel . concat ( prevChildless ) ;
113
124
res [ i ] = colsForLevel ;
125
+ prev = colsForLevel ;
114
126
}
115
127
this . columnDimensionsByLevel = res ;
116
128
}
You can’t perform that action at this time.
0 commit comments