Array Field
The array
field.
Properties
Title | Array |
Description | Field for list of items with same data type or structure. |
Field Type | array |
Base Field Type | container |
Schema
Property | Type | Default | Description |
---|---|---|---|
items | object | Schema for array items. | |
maxItems | number | Maximum number of items. | |
minItems | number | Minimum number of items. | |
uniqueItems | boolean | Item values should be unique if true. |
Options
Property | Type | Default | Description |
---|---|---|---|
animate | boolean | true | Up and down transitions will be animated |
collapsed | boolean | Field set is initially collapsed if true. | |
collapsible | boolean | Field set is collapsible if true. | |
lazyLoading | boolean | Child fields will only be rendered when the fieldset is expanded if this option is set true. | |
legendStyle | string | button | Field set legend style. |
properties |
Example 1
Example 2
Here we use the hideToolbarWithChildren
option to keep the top-most button available to add new items to the list. We also hide the add
button in the action bar for each row.
Example 3
Example 4
Example 5
Example 6
Example 7
Example 8
Example 9
Example 10
rendered by the view into the form and usually appear as a button bar.
For the toolbar, Alpaca assumes and auto-populates a single button - add
.
For the actionbar (per item), Alpaca assumes and auto-populates the following buttons:
add
remove
up
down
Any properties you define for these actions will override the existing presets. Any new actions you define will be added to the overall set. You can explicitly enable or disable actions via the enabled
property. Disabled actions are removed from display.
By default, the array field keeps labels turned off. If you want to turn labels on, use the toolbar.showLabels
and actionbar.showLabels
options.