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 173173 [ngStyle] ="column.headerGroupStyles |igxHeaderGroupStyle:column:grid.pipeTrigger " [column] ="column "
174174 [style.min-width] ="column.calcWidth | igxHeaderGroupWidth:grid.defaultHeaderGroupMinWidth:hasMRL "
175175 [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) '>
177178 </ igx-grid-header-group >
178179 </ ng-template >
179180 </ div >
Original file line number Diff line number Diff line change @@ -98,6 +98,14 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent implem
9898 return ! col . columnGroup && col . level < this . totalDepth ? ( this . totalDepth - col . level ) * this . grid . rowHeight : this . grid . rowHeight ;
9999 }
100100
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+
101109
102110 public populateColumnDimensionsByLevel ( ) {
103111 const res = [ ] ;
@@ -106,11 +114,15 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent implem
106114 this . columnDimensionsByLevel = res ;
107115 return ;
108116 }
117+ let prev = [ ] ;
109118 const cols = this . unpinnedColumnCollection ;
110119 for ( let i = 0 ; i < this . totalDepth ; i ++ ) {
111120 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 ) ;
113124 res [ i ] = colsForLevel ;
125+ prev = colsForLevel ;
114126 }
115127 this . columnDimensionsByLevel = res ;
116128 }
You can’t perform that action at this time.
0 commit comments