@@ -14,7 +14,6 @@ import {
1414 NgZone ,
1515 Optional ,
1616 Output ,
17- QueryList ,
1817 reflectComponentType ,
1918 ViewContainerRef
2019} from '@angular/core' ;
@@ -29,7 +28,7 @@ import { IgxHierarchicalGridNavigationService } from './hierarchical-grid-naviga
2928import { IgxGridSummaryService } from '../summaries/grid-summary.service' ;
3029import { IgxGridSelectionService } from '../selection/selection.service' ;
3130import { IgxColumnResizingService } from '../resizing/resizing.service' ;
32- import { ColumnType , GridType , IGX_GRID_SERVICE_BASE , IPathSegment } from '../common/grid.interface' ;
31+ import { GridType , IGX_GRID_SERVICE_BASE , IPathSegment } from '../common/grid.interface' ;
3332import { IgxColumnGroupComponent } from '../columns/column-group.component' ;
3433import { IgxColumnComponent } from '../columns/column.component' ;
3534import { IForOfState } from '../../directives/for-of/for_of.directive' ;
@@ -212,7 +211,9 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
212211 this . columns . forEach ( column => {
213212 if ( column [ output . propName ] ) {
214213 column [ output . propName ] . pipe ( takeUntil ( column . destroy$ ) ) . subscribe ( ( args ) => {
215- const rowIslandColumn = this . getRowIslandColumn ( column , this . parentIsland . childColumns ) ;
214+ const rowIslandColumn = this . parentIsland . columnList . find ( ( col ) => col . field
215+ ? col . field === column . field
216+ : col . header === column . header ) ;
216217 rowIslandColumn [ output . propName ] . emit ( { args, owner : this } ) ;
217218 } ) ;
218219 }
@@ -276,32 +277,6 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
276277 }
277278 return this . gridAPI . getChildGrid ( path ) ;
278279 }
279-
280- private getRowIslandColumn (
281- target : ColumnType ,
282- columns : QueryList < ColumnType >
283- ) : ColumnType {
284- const targetField = target . field ?? target . header ;
285- let result ;
286-
287- for ( const col of columns ) {
288- const colField = col . field ?? col . header ;
289-
290- if ( colField === targetField ) {
291- result = col ;
292- break ;
293- } else if ( col . children ) {
294- const column = this . getRowIslandColumn ( target , col . children ) ;
295-
296- if ( column ) {
297- result = column ;
298- break ;
299- }
300- }
301- }
302-
303- return result ;
304- }
305280}
306281
307282const flatten = ( arr : any [ ] ) => {
0 commit comments