Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
booleanAttribute,
ComponentRef,
createComponent,
Directive,
EventEmitter,
Expand Down Expand Up @@ -132,6 +133,8 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
/* blazorSuppress */
public abstract expandChildren: boolean;

protected _rowIslandColumnRefs: ComponentRef<IgxColumnComponent>[] = [];

/**
* @hidden
*/
Expand All @@ -141,6 +144,7 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
topLevelCols.forEach((col) => {
col.grid = this;
const ref = this._createColumn(col);
this._rowIslandColumnRefs.push(ref);
ref.changeDetectorRef.detectChanges();
Comment on lines 144 to 148
columns.push(ref.instance);
});
Expand Down Expand Up @@ -189,7 +193,9 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
if (col.children.length > 0) {
const newChildren = [];
col.children.forEach(child => {
const newCol = this._createColumn(child).instance;
const childRef = this._createColumn(child);
this._rowIslandColumnRefs.push(childRef);
const newCol = childRef.instance;
newCol.parent = ref.instance;
newChildren.push(newCol);
});
Expand All @@ -214,6 +220,16 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
return ref;
}

public override ngOnDestroy() {
this.destroyRowIslandColumnRefs();
super.ngOnDestroy();
}

protected destroyRowIslandColumnRefs() {
this._rowIslandColumnRefs.forEach(ref => ref.destroy());
this._rowIslandColumnRefs = [];
}

protected getGridsForIsland(rowIslandID: string) {
return this.gridAPI.getChildGridsForRowIsland(rowIslandID);
}
Expand Down
Loading