Skip to content

Commit 7787e61

Browse files
committed
chore(*): remove method getSelectableChildren
1 parent 88bc94a commit 7787e61

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

projects/igniteui-angular/src/lib/grids/headers/grid-header-group.component.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export class IgxGridHeaderGroupComponent implements DoCheck {
216216
* @hidden
217217
*/
218218
get selectable() {
219-
const selectableChildren = this.getSelectableChildren(this.column.children.toArray());
219+
const selectableChildren = this.column.allChildren.filter(c => !c.hidden && c.selectable && !c.columnGroup);
220220
return this.grid.columnSelection !== 'none' &&
221221
this.column.applySelectableClass
222222
&& !this.selected && selectableChildren.length > 0
@@ -248,7 +248,7 @@ export class IgxGridHeaderGroupComponent implements DoCheck {
248248
* @hidden
249249
*/
250250
public groupClicked(event): void {
251-
const columnsToSelect = this.getSelectableChildren(this.column.children.toArray()).map(c => c.field);
251+
const columnsToSelect = this.column.allChildren.filter(c => !c.hidden && c.selectable && !c.columnGroup).map(c => c.field);
252252
if (this.grid.columnSelection !== 'none' && columnsToSelect.length > 0 && !this.grid.filteringService.isFilterRowVisible) {
253253
const clearSelection = this.grid.columnSelection === 'single' || !event.ctrlKey;
254254
const rangeSelection = this.grid.columnSelection === 'multiple' && event.shiftKey;
@@ -266,20 +266,6 @@ export class IgxGridHeaderGroupComponent implements DoCheck {
266266
}
267267
}
268268

269-
private getSelectableChildren(children: IgxColumnComponent[]): IgxColumnComponent[] {
270-
let result: IgxColumnComponent[] = [];
271-
children.forEach(el => {
272-
if (el.selectable && !el.hidden) {
273-
if (el.children && el.columnGroup) {
274-
result = result.concat(this.getSelectableChildren(el.children.toArray()));
275-
} else {
276-
result.push(el);
277-
}
278-
}
279-
});
280-
return result;
281-
}
282-
283269
/**
284270
* @hidden
285271
*/

0 commit comments

Comments
 (0)