File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
projects/igniteui-angular/src/lib/grids/hierarchical-grid
src/app/hierarchical-grid Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -1108,8 +1108,8 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
1108
1108
const nestedColumns = childLayouts . map ( ( layout ) => layout . columnList . toArray ( ) ) ;
1109
1109
const colsArray = [ ] . concat . apply ( [ ] , nestedColumns ) ;
1110
1110
const colLength = this . columnList . length ;
1111
- if ( colsArray . length > 0 ) {
1112
- const topCols = this . columnList . filter ( ( item ) => colsArray . indexOf ( item ) === - 1 ) ;
1111
+ const topCols = this . columnList . filter ( ( item ) => colsArray . indexOf ( item ) === - 1 ) ;
1112
+ if ( topCols . length > 0 ) {
1113
1113
this . updateColumns ( topCols ) ;
1114
1114
if ( recalcColSizes && this . columns . length !== colLength ) {
1115
1115
this . calculateGridSizes ( false ) ;
Original file line number Diff line number Diff line change @@ -140,12 +140,17 @@ <h4 class="sample-title">Sample two</h4>
140
140
< h4 class ="sample-title "> Sample three (batch editing)</ h4 >
141
141
< div class ="sample-actions ">
142
142
< button igxButton ="raised " (click) ='riToggle = !riToggle '> Change row islands runtime</ button >
143
+ < button igxButton ="raised " (click) ="columnsReady = !columnsReady "> Toggle columns</ button >
144
+ < button igxButton ="raised " (click) ="layoutsReady = !layoutsReady "> Toggle child layouts</ button >
143
145
</ div >
144
146
< igx-hierarchical-grid [batchEditing] ="true "
145
- [rowEditable] ="true " [primaryKey] ="'ID' " [data] ="localData " [autoGenerate] ="true " [height] ="'600px' " [width] ="'800px' " #hGrid2 >
146
-
147
- < igx-row-island [key] ="'childData' " [primaryKey] ="'ID' " [autoGenerate] ="true " [rowSelection] ='selectionMode ' [batchEditing] ="true " [rowEditable] ="true "
147
+ [rowEditable] ="true " [primaryKey] ="'ID' " [data] ="localData " [height] ="'600px' " [width] ="'800px' " #hGrid2 >
148
+ < igx-column *ngIf ="columnsReady " field ="ID "> </ igx-column >
149
+ < igx-column *ngIf ="columnsReady " field ="ProductName "> </ igx-column >
150
+ < igx-row-island *ngIf ="layoutsReady " [key] ="'childData' " [primaryKey] ="'ID' " [rowSelection] ='selectionMode ' [batchEditing] ="true " [rowEditable] ="true "
148
151
[allowFiltering] ="true ">
152
+ < igx-column field ="ID "> </ igx-column >
153
+ < igx-column field ="ChildLevels "> </ igx-column >
149
154
< div *ngIf ='riToggle '>
150
155
< igx-row-island [key] ="'childData' " [autoGenerate] ="true " [rowSelection] ='selectionMode ' [batchEditing] ="true " [rowEditable] ="true "
151
156
[allowFiltering] ="true "> </ igx-row-island >
Original file line number Diff line number Diff line change @@ -14,12 +14,13 @@ import {
14
14
templateUrl : 'hierarchical-grid.sample.html'
15
15
} )
16
16
export class HierarchicalGridSampleComponent implements AfterViewInit {
17
+ public columnsReady = false ;
18
+ public layoutsReady = false ;
17
19
@ViewChild ( 'layout1' , { static : true } )
18
20
private layout1 : IgxRowIslandComponent ;
19
21
20
22
@ViewChild ( 'hGrid2' , { static : true } )
21
23
private hGrid2 : IgxHierarchicalGridComponent ;
22
-
23
24
public localData = [ ] ;
24
25
public localData1 = [ ] ;
25
26
public data1 = [ ] ;
You can’t perform that action at this time.
0 commit comments