diff --git a/projects/igniteui-angular/core/src/data-operations/merge-strategy.ts b/projects/igniteui-angular/core/src/data-operations/merge-strategy.ts index 1f0c397054f..280299b8bf0 100644 --- a/projects/igniteui-angular/core/src/data-operations/merge-strategy.ts +++ b/projects/igniteui-angular/core/src/data-operations/merge-strategy.ts @@ -64,7 +64,7 @@ export class DefaultMergeStrategy implements IGridMergeStrategy { const recData = result[index]; // if this is active row or some special record type - add and skip merging - if (activeRowIndexes.indexOf(index) != -1 || (grid && grid.isDetailRecord(rec) || grid.isGroupByRecord(rec) || grid.isChildGridRecord(rec))) { + if (activeRowIndexes.indexOf(index) != -1 || (grid && grid.isDetailRecord(rec) || grid.isGroupByRecord(rec) || grid.isChildGridRecord(rec) || grid.isSummaryRow(rec))) { if (!recData) { result.push(rec); } diff --git a/projects/igniteui-angular/grids/grid/src/cell-merge.spec.ts b/projects/igniteui-angular/grids/grid/src/cell-merge.spec.ts index 46a12dbee2c..918975267a2 100644 --- a/projects/igniteui-angular/grids/grid/src/cell-merge.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/cell-merge.spec.ts @@ -308,6 +308,27 @@ describe('IgxGrid - Cell merging #grid', () => { }); + describe('Summaries', () => { + it('should merge correctly when summary row is shown.', () => { + grid.groupBy({ + fieldName: 'ProductName', dir: SortingDirection.Desc, + ignoreCase: false, strategy: DefaultSortingStrategy.instance() + }); + fix.detectChanges(); + + const col = grid.getColumnByName('ProductName'); + col.hasSummary = true; + fix.detectChanges(); + + GridFunctions.verifyColumnMergedState(grid, col, [ + { value: 'NetAdvantage', span: 2 }, + { value: 'Ignite UI for JavaScript', span: 3 }, + { value: 'Ignite UI for Angular', span: 3 }, + { value: null, span: 1 } + ]); + }); + }); + describe('Master-Detail', () => { it('should interrupt merge sequence if a master-detail row is expanded.', () => { diff --git a/src/app/grid-cellMerging/grid-cellMerging.component.html b/src/app/grid-cellMerging/grid-cellMerging.component.html index b578fb8c3ef..aa3b8ffe2c8 100644 --- a/src/app/grid-cellMerging/grid-cellMerging.component.html +++ b/src/app/grid-cellMerging/grid-cellMerging.component.html @@ -50,7 +50,7 @@

Grid with cell merge

Value: {{val}},Index: {{cell.row.index}} - + @@ -95,7 +95,7 @@

Hierarchical grid with cell merge

- + @@ -113,7 +113,7 @@

Tree grid with cell merge

- +