repeat

Repeat module.

Two important concepts are used:

  1. The first XLST-added repeat view is cloned to serve as a template of that repeat.
  2. Each repeat series has a sibling .or-repeat-info element that stores info that is relevant to that series.

Note that with nested repeats you may have many more series of repeats than templates, because a nested repeat may have multiple series.

Source:

Methods

(static) add(repeatInfo, toCreateopt, triggeropt) → {boolean}

Source:

Clone a repeat group/node.

Parameters:
Name Type Attributes Description
repeatInfo Element

A repeatInfo element.

toCreate number <optional>

Number of clones to create.

trigger string <optional>

The trigger ('magic', 'user', 'count', 'model')

Returns:

Cloning success/failure outcome.

Type
boolean

(static) countUpdate(updated)

Source:

Checks whether repeat count value has been updated and updates repeat instances accordingly.

Parameters:
Name Type Description
updated UpdatedDataNodes

The object containing info on updated data nodes.

(static) init()

Source:

Initializes all Repeat Groups in form (only called once).

(static) updateDefaultFirstRepeatInstance(repeatInfo)

Source:

[updateDefaultFirstRepeatInstance description]

Parameters:
Name Type Description
repeatInfo Element

repeatInfo element

(static) updateRepeatInstancesFromCount(repeatInfo)

Source:

[updateRepeatInstancesFromCount description]

Parameters:
Name Type Description
repeatInfo Element

repeatInfo element

(static) updateViewInstancesFromModel(repeatInfo) → {number}

Source:

[updateViewInstancesFromModel description]

Parameters:
Name Type Description
repeatInfo Element

repeatInfo element

Returns:

length of repeat series in model

Type
number