get all rows data in devXtreme Angular - update method

48 views Asked by At

When using the DataGrid in DevExtreme and wanting to edit an object, the DataGrid only returns the edited data. How can I retrieve all the data from the DataGrid for updating all the data?

I expect to have both edited and unedited data for the update method.

1

There are 1 answers

0
Fappy On

You can achieve this by doing:

html:

<dx-data-grid ... (onSaving)="onSaving($event)"></dx-data-grid>

TS:

onSaving = async (e: any) => {
 const change = e.changes[0];
 if (change.type === 'update') {
    const rowData = await e.component.byKey(change.key);

    //MERGING CHANGES WITH ROWDATA
    change.data = Object.assign({}, rowData, change.data)
 }
}