角度 UI 网格 API 无法捕获最后一个单元格编辑



我想显示并捕获最后编辑的单元格,但它不像官方文档中提供的示例那样工作

$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();
    });
};

有人能告诉我出了什么问题吗?或者用叉子叉我的plunk,并提供一个工作示例的链接吗?

我正在使用AngularUI Grid 3.0

您需要将$scope.gridOptions.onRegisterApi保留在控制器内。看看这个。

相关内容

最新更新