The chooser
field.
Title | Chooser Field |
Description | Chooser Field |
Field Type | chooser |
Base Field Type | None |
Property | Type | Default | Description |
---|---|---|---|
default | any | The default value to be assigned for this property. If the data for the field is empty or not provided, this default value will be plugged in for you. Specify a default value when you want to pre-populate the field's value ahead of time. | |
dependencies | array | List of property dependencies. | |
description | string | Detailed description of the property. | |
disallow | array | List of disallowed values for the property. | |
enum | array | List of field value options | |
format | string | Data format of the property. | |
readonly | boolean | Indicates that the field is read-only. A read-only field cannot have it's value changed. Read-only fields render in a grayed-out or disabled control. If the field is rendered using a view with the displayReadonly attribute set to false, the read-only field will not appear. | |
required | boolean | Indicates whether the field's value is required. If set to true, the field must take on a valid value and cannnot be left empty or unassigned. | |
title | string | Short description of the property. | |
type | string | Data type of the property. |
Property | Type | Default | Description |
---|---|---|---|
dataSource | string | Datasource for generating list of options. This can be a string or a function. If a string, it is considered S be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list. | |
disabled | boolean | Field will be disabled if true. | |
fieldClass | string | Specifies one or more CSS classes that should be applied to the dom element for this field once it is rendered. Supports a single value, comma-delimited values, space-delimited values or values passed in as an array. | |
focus | checkbox | true | If true, the initial focus for the form will be set to the first child element (usually the first field in the form). If a field name or path is provided, then the specified child field will receive focus. For example, you might set focus to 'name' (selecting the 'name' field) or you might set it to 'client/name' which picks the 'name' field on the 'client' object. |
form | object | Options for rendering the FORM tag. | |
height | number | Specify a fixed height for the list boxes. If not provided, the list boxes size to the amount of data. | |
helper | string | Field help message. | |
helpers | array | An array of field help messages. Each message will be displayed on it's own line. | |
helpersPosition | string | below | Defines the placement location of the helper text relative to the control (either 'above' or 'below') |
hidden | boolean | Field will be hidden if true. | |
hideInitValidationError | boolean | Hide initial validation errors if true. | |
hideNone | boolean | Whether to hide the None option from a list (select, radio or otherwise). This will be true if the field is required and false otherwise. | |
id | string | Unique field id. Auto-generated if not provided. | |
join | function | For multiple select lists. Defines a f(a) for how selected options should be combined into a single string. A split function should also be defined which reverses this function. | |
label | string | Field label. | |
name | string | Field Name. | |
noneLabel | string | None | The label to use for the 'None' option in a list (select, radio or otherwise). |
optionLabels | array | An array of string labels for items in the enum array | |
readonly | boolean | Field will be readonly if true. | |
removeDefaultNone | boolean | If true, the default 'None' option will not be shown. | |
showAllSelections | boolean | When true, show full selection list and disable anything already selected | |
showMessages | boolean | true | Display validation messages if true. |
sort | function | Defines an f(a,b) sort function for the array of enumerated values [{text, value}]. This is used to sort enum and optionLabels as well as results that come back from any data sources (for select and radio controls). By default the items are sorted alphabetically. Don't apply any sorting if false. | |
split | function | For multiple select lists. Defines a f(a) for how data strings should be split into individual values. A join function should also be defined which reverses this function. | |
type | string | chooser | Field type. |
useDataSourceAsEnum | boolean | true | Whether to constrain the field's schema enum property to the values that come back from the data source. |
validate | boolean | true | Field validation is required if true. |
view | string | Allows for this field to be rendered with a different view (such as 'display' or 'create') |
A simple example for a string
field with enumerated values.
An example of a string value where enumerated values are loaded from a data source.
An example with showAllSelections
set to true
. This makes it so that the left-hand side always shows all values.
Selected values are grayed out (or disabled).
In this example, we set height
to 90px
which lets you control the amount of vertical screen real estate the control
will use. This introduces scroll bars for selecting values.
Here we show how to mount the control on top of an array.
Here we include buttons to enable and disable the control.
A display version of the control.
An example where we set the value after render.
An example using custom delimiters