Class: List

.fields. List


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

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 created

Parameters:
Name Type Description
val *

(optional) value matching schema type

Returns:

this

Type
apy.components.fields.List

<static> reset()

Reset inner value to its original value ($memoValue) if different

Returns:

this

Type
apy.components.fields.List

<static> selfCommit()

List Field Method to update itself.

Reset $memo to the current components count Call each inner component selfCommit method

Returns:

this

Type
apy.components.fields.List

<static> setValue(value)

Set a given value to attributes $value & $memo respectively, using cloneValue method

Load each inner component with given value

Parameters:
Name Type Description
value Array

An Array instance representing a List of Resources

Returns:

this

Type
apy.components.fields.List

<static> validate()

Override parent property to specified validation behaviour.

Throws:

When validation fails

Type
apy.errors.Error