From: Coleman Watts Date: Mon, 4 Nov 2019 13:02:23 +0000 (-0500) Subject: Dynamic option lists for select elements X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7c3878d0f0802f7cbde439129aac07271e547161;p=civicrm-core.git Dynamic option lists for select elements This should respond better to changes in the model. --- diff --git a/ext/afform/core/ang/afField/afField.js b/ext/afform/core/ang/afField/afField.js index 6c70a98e70..bd30e103d8 100644 --- a/ext/afform/core/ang/afField/afField.js +++ b/ext/afform/core/ang/afField/afField.js @@ -17,9 +17,11 @@ $scope.getData = $scope.afFieldset.getData; $scope.getOptions = function() { - return _.transform($scope.defn.options, function(result, val, key) { - result.push({id: key, text: val}); - }, []); + return { + results: _.transform($scope.defn.options, function(result, val, key) { + result.push({id: key, text: val}); + }, []) + }; }; $el.addClass('af-field-type-' + _.kebabCase($scope.defn.input_type)); diff --git a/ext/afform/core/ang/afField/widgets/Select.html b/ext/afform/core/ang/afField/widgets/Select.html index e59b2c724e..01ae74fbe8 100644 --- a/ext/afform/core/ang/afField/widgets/Select.html +++ b/ext/afform/core/ang/afField/widgets/Select.html @@ -1 +1 @@ - +