Is there a way to specify an auxiliary parameter in the schema? I tried:
Scheme
{ favoriteColor: { type: String, autoform: { options: "colorOptions" } } }
But that does not work.
The following method works fine to display a selection with parameters in the form:
Scheme
{ favoriteColor: { type: String } }
Assistant
Template.myFormTemplate.helpers({ colorOptions: function () { return Colors.find().map(function (c) { return {label: c.name, value: c._id}; }); } });
Template
{{> afQuickField name="favoriteColor" options=colorOptions}}
In my real scheme, I have an array of objects, and in each object I need to select an element from another collection. When you use afArrayField, you can no longer set parameters in the template, as it was in the above template (because it is an array of objects, and one element in the object will refer to the helper).
Am I the only option to query the database when I define the schema? I think that will make it non-reactive, right?
source share