Angular UI Grid API在捕获最后一个单元格编辑时不起作用

时间:2015-11-23 11:11:31

标签: angularjs angular-ui angular-ui-grid

我想显示并捕获最后编辑的单元格,但它并不像提供的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并提供指向工作示例的链接吗?

我正在使用AngularUI Grid 3.0

1 个答案:

答案 0 :(得分:0)

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

相关问题