-
Notifications
You must be signed in to change notification settings - Fork 278
Closed
Description
Hi,
I am trying to assign dynamic values to select option as below:
AccountsTemplates.addFields([
{
_id: 'customField',
type: 'select',
displayName: 'Custom Field',
select: custFunct(),
}
]);
custFunct() is a function i have defined as below
var custFunct = function() {
var jsonArr = [];
var jsonObj = {};
jsonObj.text = "Cust1";
jsonObj.value = "cust1";
jsonArr.push(jsonObj);
jsonObj = {};
jsonObj.text = "Cust2";
jsonObj.value = "cust2";
jsonArr.push(jsonObj);
return jsonArr;
};
Post this I am able to see the dropdown getting populated with Cust1 and Cust2 correctly
Now, i have to get these values from one of my collection which is not working as below
var custFunct = function() {
return CustCollection.find().fetch(); // this line gives error that CustCollection is not defined.
};
Kindly suggest how to proceed.
Metadata
Metadata
Assignees
Labels
No labels