Object Field
The object
field.
Properties
Title | Object |
Description | Object field for containing other fields |
Field Type | object |
Base Field Type | container |
Schema
Property | Type | Default | Description |
---|---|---|---|
maxProperties | number | The maximum number of properties that this object is allowed to have | |
minProperties | number | The minimum number of properties that this object is required to have | |
properties | object | List of child properties. |
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. |
order | number | Allows for optional specification of the index of this field in the properties array. |
Example 1
A simple object field. If you give Alpaca an object as it's data, it automatically figures out what to do and sets up both sub-fields for you.
Example 2
Here we provide a schema to go along with our data. The schema simply provides a bit more information about the two sub-fields, such as their type and labels.
Example 3
Here is a more complex example that provides the data, schema and options for all of the sub-fields of the object.
Example 4
Object field with schema, options and view parameter.
Example 5
Object field with default value.
Example 6
Object field with lazy loading option. The lazy loading option is useful for improving performance of rendering forms for large schemas.
Example 7
Object field rendered in display-only mode. The gender
field is hidden.
Example 8
Object with a required field specified at the field level.
Example 9
Object with a required field specified at the object-level.
Example 10
Object that utilizes field-level order
property to apply an order to child fields.
Example 11
Here is an example of an object field where we use a top-level layout and a nested override of the view to force the email address into display mode only.