在哪里可以找到编辑ui-grid单元时产生的事件?

时间:2015-07-28 17:47:06

标签: angularjs angular-ui-grid

在这里http://ui-grid.info/docs/#/tutorial/201_editable您读到了这些事件:BEGIN_CELL_EDIT,CANCEL_CELL_EDIT和END_CELL_EDIT。

但我找不到如何处理这些事件。 就在这里(http://ui-grid.info/docs/#/tutorial/309_editable_with_cellnav),随便,我发现以下示例使用函数afterCellEdit我想等于处理END_CELL_EDIT事件的函数

 $scope.gridOptions.onRegisterApi = function(gridApi){
          //set gridApi on scope
          $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();
          });
        };

1 个答案:

答案 0 :(得分:1)

以下是API中的答案: http://ui-grid.info/docs/#!/api/ui.grid.edit.api:PublicApi

没有删除这个问题因为我不容易找到。对其他ui-grid用户可能有用。