FieldSelect
FieldSelect
is a fully custom select field
type select
Basic example
Code
javascript
{
name: 'cityExample',
label: 'Which city is cool?',
model: 'city',
type: 'select',
options: [
{ name: 'San Francisco', value: 'SF' },
{ name: 'Amsterdam', value: 'AMS' },
{ name: 'New York', value: 'NYC' },
]
}
Multiple values
To allow for multiple values to be selected, simply add multiple: true
to your field schema object.
Code
javascript
{
name: 'cityExample',
label: 'Which city is cool?',
model: 'city',
type: 'select',
multiple: true,
options: [
{ name: 'San Francisco', value: 'SF' },
{ name: 'Amsterdam', value: 'AMS' },
{ name: 'New York', value: 'NYC' },
]
}
Properties
Shared properties
Property | Default | Type | Description |
---|---|---|---|
name | - | string | Name of the field |
model | - | string | Key of model in the form schema model |
label | - | string | Label for the field |
type | - | string | Type of field, generally input if the field is an input. |
inputType | - | string | Type of input, only required when type === 'input' |
id | computed | string | id of the field |
visible | true | Boolean | Function | Whether the field is visible, method will be passed the model , field and field component* |
required | false | Boolean | Function | Whether the field is required, method will be passed the model , field and field component* |
readonly | false | Boolean | Function | Whether the field is read only, method will be passed the model , field and field component* |
disabled | false | Boolean | Function | Whether the field is disabled, method will be passed the model , field and field component* |
hint | - | string | Function | Hint to display underneath the field, can be passed a method* |
validator | computed | Array<Function> | Function | undefined | A (list of) validator(s) to be validating the field against. |
onValidated | - | Function | undefined | Method to be called after validation has been completed. |
* see determineDynamicAttribute() for more information.
Property | Default | Type | Description |
---|---|---|---|
multiple | false | boolean | Determine if user can select multiple values |
options | - | Option[] | Selectable options |