【问题标题】:Where can I find the events produced when editing an ui-grid cell?在哪里可以找到编辑 ui-grid 单元格时产生的事件?
【发布时间】:2015-07-28 17:47:05
【问题描述】:

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

【问题讨论】:

    标签: angularjs angular-ui-grid


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2016-04-07
      • 1970-01-01
      • 2022-09-24
      • 1970-01-01
      • 2011-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-19
      相关资源
      最近更新 更多