Skip to content

Commit e0f7f00

Browse files
authored
Merge branch '9.1.x' into dkamburov/fix-6860
2 parents f03090a + 985d8d1 commit e0f7f00

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, HostBinding } from '@angular/core';
22
import { IgxGridActionsBaseDirective } from './grid-actions-base.directive';
3+
import { showMessage } from '../../core/deprecateDecorators';
34

45
@Component({
56
selector: 'igx-grid-editing-actions',
@@ -16,6 +17,8 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
1617
@HostBinding('class.igx-action-strip__editing-actions')
1718
public cssClass = 'igx-action-strip__editing-actions';
1819

20+
private isMessageShown = false;
21+
1922
/**
2023
* Enter row or cell edit mode depending the grid rowEditable option
2124
* @example
@@ -33,6 +36,12 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
3336
const row = this.strip.context;
3437
const firstEditable = row.cells.filter(cell => cell.editable)[0];
3538
const grid = row.grid;
39+
if (!grid.hasEditableColumns) {
40+
this.isMessageShown = showMessage(
41+
'The grid should be editable in order to use IgxGridEditingActionsComponent',
42+
this.isMessageShown);
43+
return;
44+
}
3645
// be sure row is in view
3746
if (grid.rowList.filter(r => r === row).length !== 0) {
3847
grid.crudService.begin(firstEditable);

projects/igniteui-angular/src/lib/grids/grid/grid-api.service.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ export class IgxGridAPIService extends GridBaseAPIService<IgxGridComponent> {
4343
names.forEach((colName) => {
4444
const grExprIndex = groupingState.findIndex((exp) => exp.fieldName === colName);
4545
const grpExpandState = this.grid.groupingExpansionState;
46-
/* remove expansion states related to the cleared group
47-
and all with deeper hierarchy than the cleared group */
48-
this.grid.groupingExpansionState = grpExpandState
49-
.filter((val) => {
50-
return val.hierarchy && val.hierarchy.length <= grExprIndex;
51-
});
46+
/* remove expansion states related to the cleared group
47+
and all with deeper hierarchy than the cleared group */
48+
const newExpandState = grpExpandState.filter((val) => {
49+
return val.hierarchy && val.hierarchy.length <= grExprIndex;
50+
});
51+
/* Do not set the new instance produced by filter
52+
when there are no differences between expansion states */
53+
if (newExpandState.length !== grpExpandState.length) {
54+
this.grid.groupingExpansionState = newExpandState;
55+
}
5256
});
5357
} else {
5458
// clear all

projects/igniteui-angular/src/lib/grids/grid/grid-summary.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,7 @@ describe('IgxGrid - Summaries #grid', () => {
16841684
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 4, ['Count', 'Min', 'Max', 'Sum', 'Avg'], ['2', '31', '43', '74', '37']);
16851685

16861686
grid.clearGrouping('OnPTO');
1687+
fix.detectChanges();
16871688
verifyBaseSummaries(fix);
16881689
verifySummariesForParentID17(fix, 3);
16891690
verifySummariesForParentID19(fix, 6);

0 commit comments

Comments
 (0)