Skip to content

Commit

Permalink
fix: #5667 honor editModelField when checking new vs old cell value
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Smith authored and Daniel Smith committed Sep 9, 2016
1 parent 5fe5a3e commit d846c5b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/features/edit/js/gridEdit.js
Expand Up @@ -732,20 +732,18 @@
return;
}

var modelField = $scope.row.getQualifiedColField($scope.col);
if ($scope.col.colDef.editModelField) {
modelField = gridUtil.preEval('row.entity.' + $scope.col.colDef.editModelField);
}

cellModel = $parse(modelField);

cellModel = $parse($scope.row.getQualifiedColField($scope.col));
//get original value from the cell
origCellValue = cellModel($scope);

html = $scope.col.editableCellTemplate;

if ($scope.col.colDef.editModelField) {
html = html.replace(uiGridConstants.MODEL_COL_FIELD, gridUtil.preEval('row.entity.' + $scope.col.colDef.editModelField));
}
else {
html = html.replace(uiGridConstants.MODEL_COL_FIELD, $scope.row.getQualifiedColField($scope.col));
}

html = html.replace(uiGridConstants.MODEL_COL_FIELD, modelField);
html = html.replace(uiGridConstants.COL_FIELD, 'grid.getCellValue(row, col)');

var optionFilter = $scope.col.colDef.editDropdownFilter ? '|' + $scope.col.colDef.editDropdownFilter : '';
Expand Down

0 comments on commit d846c5b

Please sign in to comment.