@@ -15,7 +15,7 @@ import { IgxGridGroupByRowComponent } from './groupby-row.component';
1515import { IGroupByExpandState } from '../../data-operations/groupby-expand-state.interface' ;
1616import { IForOfState , IgxGridForOfDirective } from '../../directives/for-of/for_of.directive' ;
1717import { IgxColumnComponent } from '../columns/column.component' ;
18- import { takeUntil } from 'rxjs/operators' ;
18+ import { take , takeUntil } from 'rxjs/operators' ;
1919import { IgxFilteringService } from '../filtering/grid-filtering.service' ;
2020import { IGroupingExpression } from '../../data-operations/grouping-expression.interface' ;
2121import { IgxColumnResizingService } from '../resizing/resizing.service' ;
@@ -53,6 +53,7 @@ import { IgxGridDragSelectDirective } from '../selection/drag-select.directive';
5353import { IgxGridBodyDirective } from '../grid.common' ;
5454import { IgxGridHeaderRowComponent } from '../headers/grid-header-row.component' ;
5555import { IgxGridGroupByAreaComponent } from '../grouping/grid-group-by-area.component' ;
56+ import { Observable , Subject } from 'rxjs' ;
5657
5758let NEXT_ID = 0 ;
5859
@@ -425,6 +426,16 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
425426
426427 private childDetailTemplates : Map < any , any > = new Map ( ) ;
427428
429+ /**
430+ * @hidden @internal
431+ */
432+ public groupingPerformedSubject = new Subject < void > ( ) ;
433+
434+ /**
435+ * @hidden @internal
436+ */
437+ public groupingPerformed$ : Observable < void > = this . groupingPerformedSubject . asObservable ( ) ;
438+
428439 /**
429440 * Gets/Sets the group by state.
430441 *
@@ -478,7 +489,9 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
478489 groupedColumns : groupedCols ,
479490 ungroupedColumns : ungroupedCols
480491 } ;
481- this . groupingDone . emit ( groupingDoneArgs ) ;
492+ this . groupingPerformed$ . pipe ( take ( 1 ) ) . subscribe ( ( ) => {
493+ this . groupingDone . emit ( groupingDoneArgs ) ;
494+ } ) ;
482495 }
483496 }
484497
@@ -739,6 +752,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
739752 this . _gridAPI . clear_groupby ( name ) ;
740753 this . calculateGridSizes ( ) ;
741754 this . notifyChanges ( true ) ;
755+ this . groupingPerformedSubject . next ( ) ;
742756 }
743757
744758 /**
0 commit comments