I am attempting to refresh only the specific row that has been edited in the ui-grid without refreshing the entire table.
My scenario involves editing a row in the grid, triggering a rest call, and then updating only that particular row in the grid.
Upon successful rest call:
$http.put(representation.getLink('reports').href, {
changes: manualModifications,
comment: comment
}).success(function(updatedEntities) {
for (var i = 0; i < updatedEntities.length; i++) {
angular.forEach(controller.gridOptions.data, function(entity) {
if (updatedEntities[i].factId === entity.factId) {
entity.value = updatedEntities[i].value;
entity.dataOrigin = updatedEntities[i].dataOrigin;
entity.isDirty = false;
}
});
}
controller.gridApi.core.refresh();
});
Another option that works is using:
controller.gridApi.core.refreshRows();
which updates only the rows within the grid, but still refreshes all rows.
I have checked the grid api documentation but I could not find a solution.
I believe that since I have a reference to a specific grid row inside the forEach loop, it should be possible to update just that individual row.