Hi Sanjay,
Thanks for your patience.
In Inline Edit, the Grid will automatically save the edited
record when you click inside the Grid’s content area. If you click outside of
the Grid element, the edited record will not be saved in the Grid. This is the
default behavior of Grid.
If you want to save the record when clicking outside of the
Grid element, then you need to manually execute the endEdit
method to save the data.
endEdit: https://ej2.syncfusion.com/angular/documentation/api/grid/#endedit
We have prepared a sample for your reference. In which we
bind the click event to the body element, when you click outside the grid
element, we dynamically executed the endEdit method based on the target
element.
Load: https://ej2.syncfusion.com/angular/documentation/api/grid/#load
|
[app.component.ts]
load(args) {
document.body.addEventListener('click', this.bodyClick.bind(this));
}
bodyClick(args) {
// below code executed when click out side of the grid element
if (args.target.closest('.e-grid') == null &&
args.target.closest('.e-popup') == null) {
if (this.grid.isEdit) {
// save the record if Grid in edit state
this.grid.endEdit();
}
}
}
|
Sample: https://stackblitz.com/edit/angular-fdmokf?file=app.component.ts,app.component.html
Please get back to us if you need further assistance.
Regards,
Nithya Sivaprakasam.