Skip to content

Commit

Permalink
v2 fix: .editable(false) on "reference" type field in EditView
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasia Korobkin committed Mar 7, 2015
1 parent e8ec7ab commit c8960a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(function(require) {
"use strict";

function getReadWidget() {
return '<ma-string-column value="::entry.listValues[field.name()] || entry.values[field.name()]"></ma-string-column>';
return '<ma-string-column value="::entry.listValues[field.name()]"></ma-string-column>';
}
function getLinkWidget() {
return '<a ng-click="gotoReference()">' + getReadWidget() + '</a>';
Expand Down
13 changes: 8 additions & 5 deletions src/javascripts/ng-admin/Crud/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,20 @@ define(function (require) {
},
resolve: {
view: viewProvider('EditView'),
entry: ['$stateParams', 'RetrieveQueries', 'view', function ($stateParams, RetrieveQueries, view) {
rawEntry: ['$stateParams', 'RetrieveQueries', 'view', function ($stateParams, RetrieveQueries, view) {
return RetrieveQueries.getOne(view, $stateParams.id);
}],
referencedValues: ['RetrieveQueries', 'view', 'entry', function (RetrieveQueries, view, entry) {
return RetrieveQueries.getReferencedValues(view.getReferences(), null);
referencedValues: ['RetrieveQueries', 'view', 'rawEntry', function (RetrieveQueries, view, rawEntry) {
return RetrieveQueries.getReferencedValues(view.getReferences(), [rawEntry.values]);
}],
referencedListValues: ['$stateParams', 'RetrieveQueries', 'view', 'entry', function ($stateParams, RetrieveQueries, view, entry) {
referencedListValues: ['$stateParams', 'RetrieveQueries', 'view', 'rawEntry', function ($stateParams, RetrieveQueries, view, rawEntry) {
var sortField = $stateParams.sortField,
sortDir = $stateParams.sortDir;

return RetrieveQueries.getReferencedListValues(view, sortField, sortDir, entry.identifierValue);
return RetrieveQueries.getReferencedListValues(view, sortField, sortDir, rawEntry.identifierValue);
}],
entry: ['RetrieveQueries', 'rawEntry', 'referencedValues', function(RetrieveQueries, rawEntry, referencedValues) {
return RetrieveQueries.fillReferencesValuesFromEntry(rawEntry, referencedValues, true);
}]
}
});
Expand Down

0 comments on commit c8960a4

Please sign in to comment.