Skip to content

Commit

Permalink
Merge pull request #2600 from PaulL1/1746_cell_edit
Browse files Browse the repository at this point in the history
Fix #1957 (edit): cancel all eventHandlers
  • Loading branch information
PaulL1 committed Jan 21, 2015
2 parents 270d031 + ba958b5 commit 35375f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/features/edit/js/gridEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,19 +645,25 @@
endEdit(true);
$scope.grid.api.edit.raise.afterCellEdit($scope.row.entity, $scope.col.colDef, cellModel($scope), origCellValue);
deregOnGridScroll();
deregOnEndCellEdit();
deregOnCancelCellEdit();
});

//end editing
var deregOnEndCellEdit = $scope.$on(uiGridEditConstants.events.END_CELL_EDIT, function (evt, retainFocus) {
endEdit(retainFocus);
$scope.grid.api.edit.raise.afterCellEdit($scope.row.entity, $scope.col.colDef, cellModel($scope), origCellValue);
deregOnEndCellEdit();
deregOnGridScroll();
deregOnCancelCellEdit();
});

//cancel editing
var deregOnCancelCellEdit = $scope.$on(uiGridEditConstants.events.CANCEL_CELL_EDIT, function () {
cancelEdit();
deregOnCancelCellEdit();
deregOnGridScroll();
deregOnEndCellEdit();
});

$scope.$broadcast(uiGridEditConstants.events.BEGIN_CELL_EDIT);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core/row-filtering.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ddescribe('rowSearcher', function() {
describe('rowSearcher', function() {
var grid, $scope, $compile, recompile,
rows, columns, rowSearcher, uiGridConstants, filter;

Expand Down

0 comments on commit 35375f2

Please sign in to comment.