Angular UI 网格 API 无法捕获最后的单元格编辑

Angular UI Grid API doesn't work in capturing last cell edit

我想显示和捕获最后编辑的单元格,但它不能像提供的那样工作 example in official docs

$scope.gridOptions.onRegisterApi = function(gridApi) {
    $scope.gridApi = gridApi;
    gridApi.edit.on.afterCellEdit($scope, function(rowEntity, colDef, newValue, oldValue) {
        $scope.msg.lastCellEdited = 'edited row id:' + rowEntity.id + ' Column:' + colDef.name + ' newValue:' + newValue + ' oldValue:' + oldValue;
        $scope.$apply();
    });
};

谁能告诉我哪里出了问题或分叉 my plunk 并提供 link 工作示例?

我正在使用 AngularUI Grid 3.0

您需要将 $scope.gridOptions.onRegisterApi 保留在控制器内。检查 this