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