1

I am trying to find the exact cell-data that is modified when the "ngGridEventEndCellEdit" event fires.

$scope.$on('ngGridEventEndCellEdit', function (event) {
    rowData = event.targetScope.row.entity;
    cellData = event.targetScope.row.???;
});

Reason being that the data in each ngGrid-cell (per row) contains data from several records in my db (think pivot table) and as such I would like to update only 1 db-row that relates to the specific ngGrid-cell without having to update several db-rows for each event fired.

If not I'm going to have to revert to using cellEditableTemplate + ng-change as explained here

Community
  • 1
  • 1
Precastic
  • 3,742
  • 1
  • 24
  • 29

1 Answers1

4

An easy enough solution for what I need... combining row.entity with col.field I can get the exact cell modified.

$scope.$on('ngGridEventEndCellEdit', function (event) {
    cellData = event.targetScope.row.entity[event.targetScope.col.field];
});

However, I still needed to use cellEditableTemplate + ng-change to detect whether the contents of the cell had changed & that the user hadn't just clicked in & out without changing anything.

Precastic
  • 3,742
  • 1
  • 24
  • 29