Skip to content

Commit cc7d156

Browse files
authored
Merge pull request #3114 from IgniteUI/crud-fix-vnext
branch the logic inside rowEdit event
2 parents 11247c1 + 05bfd41 commit cc7d156

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/app/grid/grid-crud-sample/crud-sample.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ export class CRUDSampleComponent implements OnInit, OnDestroy {
7070
}
7171

7272
public rowEditDone(event: IGridEditDoneEventArgs) {
73-
this.grid.isLoading = true;
74-
this._crudService.update(event.newValue).subscribe((rec) => {
75-
this.grid.isLoading = false;
76-
this.snackbar.open(`Row with ID of ${rec.ID} was edited.`);
77-
});
73+
if (!event.isAddRow) {
74+
this.grid.isLoading = true;
75+
this._crudService.update(event.newValue).subscribe((rec) => {
76+
this.grid.isLoading = false;
77+
this.snackbar.open(`Row with ID of ${rec.ID} was edited.`);
78+
});
79+
}
7880
}
7981

8082
public removeRow(row: IgxGridRow) {

0 commit comments

Comments
 (0)