Nodes class
📖 Description
The Nodes
class represents a collection of nodes in a form definition. Each node in the collection is a Node
instance.
🗃️ Fields
🏷️ all
Retrieves all the nodes that are in the collection.
Type
🏷️ count
Retrieves the number of nodes in the collection.
Type
number
🏷️ firstItem
Retrieves the first node in the collection.
Type
Node
| undefined
🏷️ lastItem
Retrieves the last node in the collection.
Type
Node
| undefined
▶️ Methods
🔧 each
Iterates through all nodes in the collection.
Signature
each(fn: (node: Node) => boolean | void): boolean
Parameters
Name | Type | Optional | Description |
---|---|---|---|
fn | (node: Node ) => boolean | void | No | Function that is called for each node in the collection. If you want to stop the iteration, you can return true from this function to do so. |
Return value
Returns true
if the iteration was stopped (break).
🔧 reverseEach
Iterates through all nodes in the collection in reverse direction (starting with the last node).
Signature
reverseEach(fn: (node: Node) => boolean | void): boolean
Parameters
Name | Type | Optional | Description |
---|---|---|---|
fn | (node: Node ) => boolean | void | No | Function that is called for each node in the collection. If you want to stop the iteration, you can return true from this function to do so. |
Return value
Returns true
if the iteration was stopped (break).