Hello,
I have a igx grid with editable rows. When cells from a row are edited I want to update my SQL database with the new values. Is there a row Id or something like that, so that I know which rows are edited?
Hello Silvia,
Thank you for posting in our community.
You can use rowEditDone or cellEditDone events of IgxGrid which return the rowID of the edited record.
I have created a small sample demonstrating how to edit remote records using cellEditDone event:
HTML
<igx-grid #grid [data]="data" primaryKey="objectId" (cellEditDone)="cellEditDoneHandler($event)"> … </igx-grid>
TYPESCRIPT
public cellEditDoneHandler(args: IGridEditDoneEventArgs) { const fieldName = args.column.field; this.http.put(`${this.url2}/${args.rowID}`, { [fieldName]: args.newValue }) }
Additionally, you can also use the Batch Editing feature of the IgxGrid for editing of remote data. More information about it can be found here. Please let me know if you have any further questions and concerns. Regards, Viktor Kombov Entry Level Software Developer Infragistics, Inc.