Skip to content

Commit a5800a9

Browse files
authored
Merge pull request #5671 from dgsmith2/5667_dirty_edit_model
fix: #5667 honor editModelField when checking new vs old cell value
2 parents 5fe5a3e + d846c5b commit a5800a9

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/features/edit/js/gridEdit.js

Lines changed: 7 additions & 9 deletions
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)