Skip to content

Commit cfe5a59

Browse files
committed
fix(igxCrid): update selectedCells to work with GroupBy #935
1 parent 064c301 commit cfe5a59

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

projects/igniteui-angular/src/lib/grid/column.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { IgxTextHighlightDirective } from '../directives/text-highlight/text-hig
1616
import { IgxGridAPIService } from './api.service';
1717
import { IgxGridCellComponent } from './cell.component';
1818
import { IgxDateSummaryOperand, IgxNumberSummaryOperand, IgxSummaryOperand, IgxSummaryResult } from './grid-summary';
19-
import { IgxGridSummaryComponent } from './grid-summary.component';
19+
import { IgxGridRowComponent } from './row.component';
2020
import {
2121
IgxCellEditorTemplateDirective,
2222
IgxCellFooterTemplateDirective,
@@ -228,8 +228,9 @@ export class IgxColumnComponent implements AfterContentInit {
228228
}
229229

230230
get cells(): IgxGridCellComponent[] {
231-
return this.grid.rowList.map((row) => row.cells.filter((cell) => cell.columnIndex === this.index))
232-
.reduce((a, b) => a.concat(b), []);
231+
return this.grid.rowList.filter((row) => row instanceof IgxGridRowComponent)
232+
.map((row) => row.cells.filter((cell) => cell.columnIndex === this.index))
233+
.reduce((a, b) => a.concat(b), []);
233234
}
234235

235236
get visibleIndex(): number {

projects/igniteui-angular/src/lib/grid/grid.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ export class IgxGridComponent implements OnInit, OnDestroy, AfterContentInit, Af
13791379

13801380
get selectedCells(): IgxGridCellComponent[] | any[] {
13811381
if (this.rowList) {
1382-
return this.rowList.map((row) => row.cells.filter((cell) => cell.selected))
1382+
return this.rowList.filter((row) => row instanceof IgxGridRowComponent).map((row) => row.cells.filter((cell) => cell.selected))
13831383
.reduce((a, b) => a.concat(b), []);
13841384
}
13851385
return [];

0 commit comments

Comments
 (0)