Constructor
new CategorySettingMetadata(name, label, options, defaultValue)
Passes the parameters to the superclass for initialization, then marks this setting as one that should be represented in the UI using a drop-down list with the given array of values as its options.
Parameters
-
name
String
passed to superclass constructor
-
label
String
passed to superclass constructor
-
options
Array.<String>
array of valid values in this categorical data type, in the order they should be presented to the user when editing a setting with this metadata
-
defaultValue
String
passed to superclass constructor; should be on the list of
options
Source
Classes
Methods
convert(data) → {String}
Ensures that the value given is on the list of valid values. If it is not, it replaces it with the first value on the list of valid values.
Parameters
-
data
any
the data to convert to an item in this category
Returns
-
String
the same data, if it is a valid element in this category, or the first valid element in this category otherwise