Ok. So a new version of jamovi (2.6.11) has been uploaded that allows for more complicated conditions in the u.yaml. Essentially it enables the use of javascript in the u.yaml for some properties. For example, the current system (which continues to function) might look like this
where postHocES is of type NMXList, which means its value is an array of options. This 'enable' property example could now also be expressed in javascript as
Code: Select all
enable: ({ return ui['postHocES'].value()?.includes('d'); })
Obviously in the above example, the former is more concise and should be used, however, it can be seen that any javascript can be used as long as it returns the appropriate type for the option property.
In regards to the initial inquiry, the following can be used.
Code: Select all
enable: ({ return ui['groupingVar'].value()?.length == 2; })
The ? is an optional chaining operator and is needed because the value of ui['groupingVar'].value() can be null and therefore an exception is avoided if it is the case.
Currently options need to be referred to using single quotation marks in the following form ui['
optionName'].value()
If there are any questions or issues please let me know.