Skip to content

Commit

Permalink
fix(*): do not clear summaries when row edit is not complete #10617
Browse files Browse the repository at this point in the history
  • Loading branch information
ddincheva committed Apr 4, 2023
1 parent 04e811f commit e514c32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions projects/igniteui-angular/src/lib/grids/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ export class GridBaseAPIService<T extends GridType> implements GridServiceType {
return;
}
const args = cell.createEditEventArgs(true);

this.grid.summaryService.clearSummaryCache(args);
if (!this.grid.crudService.row) {
this.grid.summaryService.clearSummaryCache(args);
}
const data = this.getRowData(cell.id.rowID);
const newRowData = reverseMapper(cell.column.field, args.newValue);
this.updateData(this.grid, cell.id.rowID, data, cell.rowData, newRowData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,6 @@ describe('IgxGrid - Row Editing #grid', () => {
summaryRow = fix.debugElement.query(By.css(SUMMARY_ROW));
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 3,
['Count', 'Earliest', 'Latest'], ['10', 'May 17, 1990', 'Dec 25, 2025']);

GridFunctions.simulateGridContentKeydown(fix, 'enter');
tick(16);
fix.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ describe('Edit cell with data of type Array #grid', () => {

delete rowArgs.cancel;
rowArgs.rowData = initialRowData;
rowArgs.data = initialRowData;
expect(grid.rowEditDone.emit).toHaveBeenCalledTimes(1);
expect(grid.rowEditDone.emit).toHaveBeenCalledWith(rowArgs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class IgxGridSummaryService {
}
return;
}
debugger;
if (args.data) {
const rowID = this.grid.primaryKey ? args.data[this.grid.primaryKey] : args.data;
this.removeSummaries(rowID);
Expand Down Expand Up @@ -190,6 +191,9 @@ export class IgxGridSummaryService {
);
}
const rowData = this.grid.primaryKey ? data.find(rec => rec[this.grid.primaryKey] === rowID) : rowID;
if(!rowData) {
return summaryIDs;
}
let id = '{ ';
groupingExpressions.forEach(expr => {
id += `'${expr.fieldName}': '${rowData[expr.fieldName]}'`;
Expand Down

0 comments on commit e514c32

Please sign in to comment.