【发布时间】: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();
});
};
【问题讨论】: