I'm trying to keep a grid's filter after updating a row.
When I click on a row in the grid, I open a dialog where I update the informations for this row, and then I look for the clicked row in the grid's rowData after that I update the corresponding record in the rowData with the values from the dialog, as following :
row[0].x = dg.x;
row[0].y = dg.y;
dg.gridOptions.rowData[index] = row[0];
dg.gridOptions.api.setRowData(newRows);
But after this I loose the filter on the grid, I did some search and I tried all the following solutions :
Setting the
gridOptionspropertydeltaRowDataModetotrue.filterParams: {apply: true, newRowsAction: 'keep'}
But none of these has worked.
How can I solve this ?
updateGridfunction, and any other relevant code. You probably need to do your update differently. ag-grid.com/javascript-grid-data-update - thirtydotsetRowDataif you want to keep your filter selection, here's a quote from the link in my previous comment: "When you call api.setRowData(newData), the grid discards all previous selections and filters, and completely overwrites the old data with the new.". Read through the docs and look at the demos/code to find the solution. If you need more help, let me know and I'll write an answer. - thirtydot