在哪里可以找到编辑ui网格单元格时产生的事件



在这里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();
          });
        };

在API中给出了答案:http://ui-grid.info/docs/# !/api/ui.grid.edit.api: PublicApi

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

最新更新