Add the following to the controller:
$scope.gridOptions.onRegisterApi = function(gridApi) { //set gridApi on scope $scope.gridApi = gridApi; gridApi.edit.on.afterCellEdit($scope, function(rowEntity, colDef, newValue, oldValue) { //Do your REST call here via $http.get or $http.post //Alert to show what info about the edit is available alert('Column: ' + colDef.name + ' ID: ' + rowEntity.id + ' Name: ' + rowEntity.name + ' Age: ' + rowEntity.age); }); };
You have all the information about which column has been edited (in colDef.name ) and what are the actual cell values ββ(in rowEntity.xxx ).
All you have to do is call your REST API (to avoid unnecessary traffic, you can also compare newValue with oldValue to see if the content has really been changed).
You do not need to reload the data because the changes are already applied to the area.
Find the forked plunker here.
The second part of your question:
None of your rows can be selected. And it can get a little harder. Please start a new question (with the new Plunker) about this issue.
source share