}
};
- this.getSearchDisplay = function(node) {
- var searchKey = $scope.getSearchKey(node);
- if (searchKey) {
+ // Finds a SearchDisplay within this container or within the fieldset containing this container
+ this.getSearchDisplay = function() {
+ var searchKey = ctrl.getDataEntity();
+ if (searchKey && !ctrl.entityName) {
return afGui.getSearchDisplay.apply(null, searchKey.split('.'));
}
};
var joinType = ctrl.entityName.split('-join-');
entityType = joinType[1] || (ctrl.editor && ctrl.editor.getEntity(joinType[0]).type);
} else {
- var searchKey = ctrl.getDataEntity(),
- searchDisplay = afGui.getSearchDisplay.apply(null, searchKey.split('.')),
+ var searchDisplay = ctrl.getSearchDisplay(),
fieldName = fieldKey.substr(fieldKey.indexOf('.') + 1),
prefix = _.includes(fieldKey, '.') ? fieldKey.split('.')[0] : null;
if (prefix) {
this.getDefn = function() {
var defn = afGui.getField(ctrl.container.getFieldEntityType(ctrl.node.name), ctrl.node.name);
// Calc fields are specific to a search display, not part of the schema
- if (!defn && ctrl.container.getSearchDisplay(ctrl.container.node)) {
- var searchDisplay = ctrl.container.getSearchDisplay(ctrl.container.node);
+ if (!defn && ctrl.container.getSearchDisplay()) {
+ var searchDisplay = ctrl.container.getSearchDisplay();
defn = _.findWhere(searchDisplay.calc_fields, {name: ctrl.node.name});
}
defn = defn || {