Skip to content

Commit d846c5b

Browse files
Daniel SmithDaniel Smith
Daniel Smith
authored and
Daniel Smith
committed
fix: #5667 honor editModelField when checking new vs old cell value
1 parent 5fe5a3e commit d846c5b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/features/edit/js/gridEdit.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -732,20 +732,18 @@
732732
return;
733733
}
734734

735+
var modelField = $scope.row.getQualifiedColField($scope.col);
736+
if ($scope.col.colDef.editModelField) {
737+
modelField = gridUtil.preEval('row.entity.' + $scope.col.colDef.editModelField);
738+
}
739+
740+
cellModel = $parse(modelField);
735741

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

740745
html = $scope.col.editableCellTemplate;
741-
742-
if ($scope.col.colDef.editModelField) {
743-
html = html.replace(uiGridConstants.MODEL_COL_FIELD, gridUtil.preEval('row.entity.' + $scope.col.colDef.editModelField));
744-
}
745-
else {
746-
html = html.replace(uiGridConstants.MODEL_COL_FIELD, $scope.row.getQualifiedColField($scope.col));
747-
}
748-
746+
html = html.replace(uiGridConstants.MODEL_COL_FIELD, modelField);
749747
html = html.replace(uiGridConstants.COL_FIELD, 'grid.getCellValue(row, col)');
750748

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

0 commit comments

Comments
 (0)