I have built two grids Grid_A and Grid_B which both contain a column called "Activite".
When the user edits this column cells in Grid_A, the same values get displayed in this column in Grid_B
I have made this work through a service that communicates the data between the two grids components.
"Activite" in grid_A
"Activite" in grid_B
Until here, everything is perfect. However, when I go back to grid A and modify a cell from this column.
In grid_B, I lose the previous values of the other cells:
Here's the code that populates the column in grid_B:
onGridReady(params) {
this.gridApi = params.api;
params.api.sizeColumnsToFit();
for(let i = 0;i<this.editedRowId.length;i++) {
var rowNode = this.gridApi.getRowNode(this.editedRowIds[i]);
rowNode.setDataValue('activite', this.editedActiviteValues[i]);
}
So, here are my questions:
1/ Why do I lose the values in the other cells after I edit the second cell with setDataValue?
2/ Is there an ag-grid native way to ensure data-persistence?
3/ Should I start using a database(for ex: MongoDb) to reach my goal of data persistence among grids?
Thank you!
PS: If I don't edit the Activite column in Grid_A. The data in Activite column in Grid_B remains untouched. I.e: The data persists. It only disappears if I modify the data again in Grid_A.