@@ -1015,6 +1015,19 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
10151015
10161016 expect ( fixture . componentInstance . childGridRef . elementRef . nativeElement ) . toEqual ( child1Grid . nativeElement ) ;
10171017 } ) ;
1018+
1019+ it ( 'should update columns property of row islands on columns change.' , fakeAsync ( ( ) => {
1020+
1021+ expect ( hierarchicalGrid . childLayoutList . first . columns . length ) . toEqual ( 2 , 'Initial columns length should be 2' ) ;
1022+ expect ( hierarchicalGrid . childLayoutList . first . columnList . length ) . toEqual ( 2 , 'Initial columnList length should be 2' ) ;
1023+
1024+ fixture . componentInstance . toggleColumns = false ;
1025+ fixture . detectChanges ( ) ;
1026+ tick ( ) ;
1027+
1028+ expect ( hierarchicalGrid . childLayoutList . first . columns . length ) . toEqual ( 0 , 'Columns length should be 0 after toggle' ) ;
1029+ expect ( hierarchicalGrid . childLayoutList . first . columnList . length ) . toEqual ( 0 , 'ColumnList length should be 0 after toggle' ) ;
1030+ } ) ) ;
10181031 } ) ;
10191032
10201033 describe ( 'IgxHierarchicalGrid Children Sizing #hGrid' , ( ) => {
@@ -1867,8 +1880,8 @@ export class IgxHierarchicalGridTestBaseComponent {
18671880 <igx-column field="ID"></igx-column>
18681881 <igx-column field="ProductName"></igx-column>
18691882 <igx-row-island [key]="'childData'" [autoGenerate]="false" [height]="height" #rowIsland1>
1870- <igx-column field="ID"></igx-column>
1871- <igx-column field="ProductName"></igx-column>
1883+ <igx-column field="ID" *ngIf="toggleColumns" ></igx-column>
1884+ <igx-column field="ProductName" *ngIf="toggleColumns" ></igx-column>
18721885 </igx-row-island>
18731886 <igx-row-island [key]="'childData2'" [autoGenerate]="false" [height]="height" #rowIsland2>
18741887 <igx-column field="Col1"></igx-column>
@@ -1877,12 +1890,13 @@ export class IgxHierarchicalGridTestBaseComponent {
18771890 </igx-row-island>
18781891 </igx-hierarchical-grid>` ,
18791892 standalone : true ,
1880- imports : [ IgxHierarchicalGridComponent , IgxColumnComponent , IgxRowIslandComponent ]
1893+ imports : [ IgxHierarchicalGridComponent , IgxColumnComponent , IgxRowIslandComponent , NgIf ]
18811894} )
18821895export class IgxHierarchicalGridMultiLayoutComponent extends IgxHierarchicalGridTestBaseComponent {
18831896 @ViewChild ( 'rowIsland1' , { read : IgxRowIslandComponent , static : true } ) public rowIsland1 : IgxRowIslandComponent ;
18841897 @ViewChild ( 'rowIsland2' , { read : IgxRowIslandComponent , static : true } ) public override rowIsland2 : IgxRowIslandComponent ;
18851898 public height = '100px' ;
1899+ public toggleColumns = true ;
18861900}
18871901
18881902@Component ( {
0 commit comments