I am using Infinite Row Model and when i deleted the selected row from Grid then i am calling refreshing cache so lets say i deleted the selected id = 1 but after refreshInfiniteCache(); new row comes from DB via getRows() its id = 2 and that selected row does not get un-select auto and if i am clicking on delete button again then I am getting two rows in selectedData. Why is that? from this.gridApi.getSelectedRows() and getSelectedNodes() i am getting two rows previous row id = 1 and next row which came after delete that is id = 2. I should get only one row id = 2 not id = 1 again i have deleted this row and refreshed cache. Please tell me am i missing something?
deleteRow() {
const selectedData = this.gridApi.getSelectedRows();
this.assetTypeService.deleteAssetType(selectedData[0].AssetTypeID)
.subscribe((result) => {
this.gridApi.refreshInfiniteCache();
})
}
So you can call
refreshInfiniteCache()
if you will replace all grid data viasetRowData(rows)
or you need to update the grid data after completing a delete request.
You can try the below code inside the deleteRow() function: