new List(name, type, schema, value, $endpoint, service, $states, relationName)
Apy List Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Field name |
type |
string | Field type |
schema |
Object | Field schema |
value |
Object | Field value |
$endpoint |
string | Field endpoint |
service |
Object | Reference to Service instance |
$states |
Object | Field inner state holder instance |
relationName |
string | (optional) Field relation name |
Extends
- apy.components.ComponentMixin
- apy.components.fields.FieldMixin
- apy.components.RequestMixin
- apy.components.CompositeMixin
Methods
-
<static> cleanedData()
-
Get cleaned data
Returns:
An Array List
- Type
- Array
-
<static> cloneValue(value)
-
List field - clone a value
Parameters:
Name Type Description value
Array A list array
Returns:
cloned value
- Type
- Array
-
<static> hasUpdated()
-
Return true if original value has changed from current one. In other words, if inner components count has changed or if any contained component is updated.
Returns:
Is the List field updated ?
- Type
- boolean
-
<static> load(val)
-
Load each value contained into inner
$value
prop, into a matching Apy Field based on its schema.If no schema is specified, an
apy.components.fields.Poly
is createdParameters:
Name Type Description val
* (optional) value matching schema type
Returns:
this
-
<static> reset()
-
Reset inner value to its original value ($memoValue) if different
Returns:
this
-
<static> selfCommit()
-
List Field Method to update itself.
Reset
$memo
to the current components count Call each inner componentselfCommit
methodReturns:
this
-
<static> setValue(value)
-
Set a given value to attributes
$value
&$memo
respectively, usingcloneValue
methodLoad each inner component with given value
Parameters:
Name Type Description value
Array An Array instance representing a List of Resources
Returns:
this
-
<static> validate()
-
Override parent property to specified validation behaviour.
Throws:
-
When validation fails
- Type
- apy.errors.Error
-