I need to fill in a supplier with only variables present in modelterms. My strategy is to get the modelterms, remove possible interactions, convert the list into FormatDef.variable, and fill the supplier.
Code: Select all
var updateSimpleSupplier = function(ui, context) {
var termsList = context.cloneArray(ui.modelTerms.value(), []);
var varList=[];
for (var j = 0; j < termsList.length; j++) {
var newTerm=context.clone(termsList[j]);
if (newTerm.length==1) {
varList.push(newTerm);
}
}
varList=context.valuesToItems(varList, FormatDef.variable);
console.log(varList);
ui.simpleSupplier.setValue(varList);
};
However, whereas the supplier gets filled in correctly, when the user selects a variable to put in the supplier target, the variable name gets crossed over, as if the format wasn't right. Please note that the target is defined as:
Code: Select all
- name: simpleVariable
title: Simple effects variable
type: Variable
default: