Chooser Field

The chooser field.


Title Checkbox
Description Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array.
Field Type checkbox
Base Field Type list


Property Type Default Description
enum array List of field value options


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.
height number Specify a fixed height for the list boxes. If not provided, the list boxes size to the amount of data.
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.
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.
name string Field Name.
noneLabel string None The label to use for the 'None' option in a list (select, radio or otherwise).
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
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.
useDataSourceAsEnum boolean true Whether to constrain the field's schema enum property to the values that come back from the data source.

Example 1

A simple example for a string field with enumerated values.

{% raw %} {% endraw %}

Example 2

An example of a string value where enumerated values are loaded from a data source.

{% raw %} {% endraw %}

Example 3

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).

{% raw %} {% endraw %}

Example 4

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.

{% raw %} {% endraw %}

Example 5

Here we show how to mount the control on top of an array.

{% raw %} {% endraw %}

Example 6

Here we include buttons to enable and disable the control.

{% raw %} {% endraw %}

Example 7

A display version of the control.

{% raw %} {% endraw %}

Example 8

An example where we set the value after render.

{% raw %} {% endraw %}

Example 9

An example using custom delimiters

{% raw %} {% endraw %}