From 1a9e4a5e1726a42c7e1d213b1f786635eedbbc5f Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 27 Oct 2023 14:04:59 +1100 Subject: [PATCH] Move reports to top of org Reporting tab, update declaration #3005 --- grails-app/assets/javascripts/forms.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/grails-app/assets/javascripts/forms.js b/grails-app/assets/javascripts/forms.js index 8053e0e..3d47f53 100644 --- a/grails-app/assets/javascripts/forms.js +++ b/grails-app/assets/javascripts/forms.js @@ -310,6 +310,11 @@ function orEmptyArray(v) { var parentContext = _.isObject(context['$parent'].data) ? context['$parent'].data : context['$parent']; result = bindVariable(variable, parentContext); } + // Try to evaluate against the context - used when we are evaluating pre-pop data with a filter + // expression that references a variable in the form context + else if (context['$context']) { + result = bindVariable(variable, context['$context']); + } } } @@ -895,7 +900,8 @@ function orEmptyArray(v) { } constraintsInititaliser = $.Deferred(); - var dataLoader = ecodata.forms.dataLoader(context, config); + var dataLoaderContext = _.extend({}, context, {$parent:context.parent}); + var dataLoader = ecodata.forms.dataLoader(dataLoaderContext, config); dataLoader.prepop(metadata.constraints.config).done(function (data) { constraintsObservable(data); constraintsInititaliser.resolve();