static/jsvm/classes/SelectField.html
SelectField defines "select" type field for storing single or multiple string values from a predefined list.
Requires the Values option to be set.
If MaxSelect is not set or <= 1, then the field value is expected to be a single Values element.
If MaxSelect is > 1, then the field value is expected to be a subset of Values slice.
The respective zero record field value is either empty string (single) or empty string slice (multiple).
The following additional setter keys are available:
- "fieldName+" - append one or more values to the existing record one. For example: record.Set("roles+", []string{"new1", "new2"}) // []string{"old1", "old2", "new1", "new2"} - "+fieldName" - prepend one or more values to the existing record one. For example: record.Set("+roles", []string{"new1", "new2"}) // []string{"new1", "new2", "old1", "old2"} - "fieldName-" - subtract one or more values from the existing record one. For example: record.Set("roles-", "old1") // []string{"old2"}Copy
columnTypedriverValuefindSettergetHiddengetIdgetNamegetSystemisMultipleprepareValuesetHiddensetIdsetNamesetSystemtypevalidateSettingsvalidateValue
hiddenidmaxSelectnamepresentablerequiredsystemvalues
Optional data: Partial<core.SelectField>ColumnType implements [Field.ColumnType] interface method.
DriverValue implements the [DriverValuer] interface.
FindSetter implements the [SetterFinder] interface.
GetHidden implements [Field.GetHidden] interface method.
GetId implements [Field.GetId] interface method.
GetName implements [Field.GetName] interface method.
GetSystem implements [Field.GetSystem] interface method.
IsMultiple implements [MultiValuer] interface and checks whether the current field options support multiple values.
PrepareValue implements [Field.PrepareValue] interface method.
SetHidden implements [Field.SetHidden] interface method.
SetId implements [Field.SetId] interface method.
SetName implements [Field.SetName] interface method.
SetSystem implements [Field.SetSystem] interface method.
Type implements [Field.Type] interface method.
ValidateSettings implements [Field.ValidateSettings] interface method.
ValidateValue implements [Field.ValidateValue] interface method.
hidden: boolean
Hidden hides the field from the API response.
id: string
Id is the unique stable field identifier.
It is automatically generated from the name when adding to a collection FieldsList.
maxSelect: number
MaxSelect specifies the max allowed selected values.
For multiple select the value must be > 1, otherwise fallbacks to single (default).
name: string
Name (required) is the unique name of the field.
presentable: boolean
Presentable hints the Dashboard UI to use the underlying field record value in the relation preview label.
required: boolean
Required will require the field value to be non-empty.
system: boolean
System prevents the renaming and removal of the field.
values: string[]
Values specifies the list of accepted values.
OSLightDark
Generated using TypeDoc