Skip to content

Commit 502bb29

Browse files
committed
chore(*): revert last change
1 parent b6868a0 commit 502bb29

File tree

2 files changed

+45
-45
lines changed

2 files changed

+45
-45
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5909,51 +5909,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
59095909
}
59105910
}
59115911

5912-
protected _createColumn(col) {
5913-
let ref;
5914-
if (col instanceof IgxColumnGroupComponent) {
5915-
ref = this._createColGroupComponent(col);
5916-
} else {
5917-
ref = this._createColComponent(col);
5918-
}
5919-
return ref;
5920-
}
5921-
5922-
protected _createColGroupComponent(col: IgxColumnGroupComponent) {
5923-
const factoryGroup = this.resolver.resolveComponentFactory(IgxColumnGroupComponent);
5924-
const ref = this.viewRef.createComponent(factoryGroup, null, this.viewRef.injector);
5925-
ref.changeDetectorRef.detectChanges();
5926-
factoryGroup.inputs.forEach((input) => {
5927-
const propName = input.propName;
5928-
ref.instance[propName] = col[propName];
5929-
});
5930-
if (col.children.length > 0) {
5931-
const newChildren = [];
5932-
col.children.forEach(child => {
5933-
const newCol = this._createColumn(child).instance;
5934-
newCol.parent = ref.instance;
5935-
newChildren.push(newCol);
5936-
});
5937-
ref.instance.children.reset(newChildren);
5938-
ref.instance.children.notifyOnChanges();
5939-
}
5940-
return ref;
5941-
}
5942-
5943-
protected _createColComponent(col) {
5944-
const factoryColumn = this.resolver.resolveComponentFactory(IgxColumnComponent);
5945-
const ref = this.viewRef.createComponent(factoryColumn, null, this.viewRef.injector);
5946-
factoryColumn.inputs.forEach((input) => {
5947-
const propName = input.propName;
5948-
if (!(col[propName] instanceof IgxSummaryOperand)) {
5949-
ref.instance[propName] = col[propName];
5950-
} else {
5951-
ref.instance[propName] = col[propName].constructor;
5952-
}
5953-
});
5954-
return ref;
5955-
}
5956-
59575912
protected switchTransactionService(val: boolean) {
59585913
if (val) {
59595914
this._transactions = this.transactionFactory.create(TRANSACTION_TYPE.Base);

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,51 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
232232
});
233233
}
234234

235+
protected _createColumn(col) {
236+
let ref;
237+
if (col instanceof IgxColumnGroupComponent) {
238+
ref = this._createColGroupComponent(col);
239+
} else {
240+
ref = this._createColComponent(col);
241+
}
242+
return ref;
243+
}
244+
245+
protected _createColGroupComponent(col: IgxColumnGroupComponent) {
246+
const factoryGroup = this.resolver.resolveComponentFactory(IgxColumnGroupComponent);
247+
const ref = this.viewRef.createComponent(IgxColumnGroupComponent, { injector: this.viewRef.injector });
248+
ref.changeDetectorRef.detectChanges();
249+
factoryGroup.inputs.forEach((input) => {
250+
const propName = input.propName;
251+
ref.instance[propName] = col[propName];
252+
});
253+
if (col.children.length > 0) {
254+
const newChildren = [];
255+
col.children.forEach(child => {
256+
const newCol = this._createColumn(child).instance;
257+
newCol.parent = ref.instance;
258+
newChildren.push(newCol);
259+
});
260+
ref.instance.children.reset(newChildren);
261+
ref.instance.children.notifyOnChanges();
262+
}
263+
return ref;
264+
}
265+
266+
protected _createColComponent(col) {
267+
const factoryColumn = this.resolver.resolveComponentFactory(IgxColumnComponent);
268+
const ref = this.viewRef.createComponent(IgxColumnComponent, { injector: this.viewRef.injector });
269+
factoryColumn.inputs.forEach((input) => {
270+
const propName = input.propName;
271+
if (!(col[propName] instanceof IgxSummaryOperand)) {
272+
ref.instance[propName] = col[propName];
273+
} else {
274+
ref.instance[propName] = col[propName].constructor;
275+
}
276+
});
277+
return ref;
278+
}
279+
235280
protected getGridsForIsland(rowIslandID: string) {
236281
return this.hgridAPI.getChildGridsForRowIsland(rowIslandID);
237282
}

0 commit comments

Comments
 (0)