Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -6438,6 +6438,12 @@ export abstract class IgxGridBaseDirective implements GridType,
}
}

protected viewDetachHandler(args) {
if (this.actionStrip && args.view.rootNodes.find(x => x === this.actionStrip.context?.element.nativeElement)) {
Comment thread
damyanpetev marked this conversation as resolved.
this.actionStrip.hide();
}
}

/**
* @hidden @internal
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
[igxTemplateOutletContext]="getContext(rowData, rowIndex)"
(cachedViewLoaded)="cachedViewLoaded($event)"
(viewCreated)="viewCreatedHandler($event)"
(beforeViewDetach)="viewDetachHandler($event)"
(viewMoved)="viewMovedHandler($event)">
</ng-template>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<ng-template
[igxTemplateOutlet]="(isHierarchicalRecord(rowData) ? hierarchical_record_template : (isChildGridRecord(rowData) ? child_record_template : hierarchical_record_template))"
[igxTemplateOutletContext]="getContext(rowData, rowIndex, false)" (viewCreated)="viewCreatedHandler($event)"
(viewMoved)="viewMovedHandler($event)" (cachedViewLoaded)="cachedViewLoaded($event)">
(viewMoved)="viewMovedHandler($event)" (cachedViewLoaded)="cachedViewLoaded($event)" (beforeViewDetach)="viewDetachHandler($event)">
</ng-template>
<!-- <ng-container *igxTemplateOutlet="(isHierarchicalRecord(rowData) ? hierarchical_record_template : (isChildGridRecord(rowData) && isExpanded(rowData) ? child_record_template : hierarchical_record_template)); context: getContext(rowData)"></ng-container> -->
</ng-template>
Expand Down
4 changes: 4 additions & 0 deletions projects/igniteui-angular/src/lib/grids/row.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ export class IgxRowDirective implements DoCheck, AfterViewInit, OnDestroy {
* @internal
*/
public ngOnDestroy() {
// if action strip is shown here but row is about to be destroyed, hide it.
if (this.grid.actionStrip && this.grid.actionStrip.context === this) {
this.grid.actionStrip.hide();
}
this.destroy$.next(true);
this.destroy$.complete();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
(dataChanging)="dataRebinding($event)" (dataChanged)="dataRebound($event)">
<ng-template [igxTemplateOutlet]='isSummaryRow(rowData) ? summary_template : record_template'
[igxTemplateOutletContext]='getContext(rowData, rowIndex, false)'
(beforeViewDetach)="viewDetachHandler($event)"
(cachedViewLoaded)='cachedViewLoaded($event)'>
</ng-template>
</ng-template>
Expand Down
Loading