Skip to main content

Section class

๐Ÿ“– Descriptionโ€‹

The Section class represents a section of the form definition in the builder.

๐Ÿ—ƒ๏ธ Fieldsโ€‹


๐Ÿท๏ธ branchโ€‹

Retrieves a reference to parent Branch.

Typeโ€‹

Branch | undefined


๐Ÿท๏ธ branchesโ€‹

Retrieves the collection of child branches.

Typeโ€‹

Branches


๐Ÿท๏ธ hasBranchesโ€‹

Retrieves if the section has any branches.

Typeโ€‹

boolean


๐Ÿท๏ธ idโ€‹

Retrieves the identifier of the section.

Typeโ€‹

string


๐Ÿท๏ธ indexโ€‹

Retrieves the zero-based index of the section in the Sections collection.

Typeโ€‹

number


๐Ÿท๏ธ isFirstโ€‹

Retrieves if the section is the first section in the Sections collection.

Typeโ€‹

boolean


๐Ÿท๏ธ isLastโ€‹

Retrieves if the section is the last section in the Sections collection.

Typeโ€‹

boolean


๐Ÿท๏ธ isMovingโ€‹

Retrieves if the section is being moved (dragged) in the builder.

Typeโ€‹

boolean


๐Ÿท๏ธ isReadonlyโ€‹

Sets or retrieves if the nested branch (subform) is read-only.

Typeโ€‹

boolean

tip

See the Subforms guide for more information.


๐Ÿท๏ธ isRenderedโ€‹

Retrieves if the section is rendered by the builder.

Typeโ€‹

boolean


๐Ÿท๏ธ jumpsโ€‹

Retrieves a list of branches which have a jump to this section.

Typeโ€‹

Branch[]


๐Ÿท๏ธ nameโ€‹

Sets or retrieves the name of the section.

Typeโ€‹

string


๐Ÿท๏ธ nodesโ€‹

Retrieves the collection of child nodes.

Typeโ€‹

Nodes


๐Ÿท๏ธ parentโ€‹

Retrieves a reference to parent Sections collection.

Typeโ€‹

Sections


๐Ÿท๏ธ predecessorโ€‹

Retrieves a reference to the predecessor Section (if any).

Typeโ€‹

Section | undefined


๐Ÿท๏ธ referenceโ€‹

Sets or retrieves the optional reference for a nested branch (subform). This property can be used to track the origin of a subform when it was loaded from an external source. For example, the identifier of a subform can be stored in this property.

Typeโ€‹

string

tip

See the Subforms guide for more information.


๐Ÿท๏ธ successorโ€‹

Retrieves a reference to the successor Section (if any).

Typeโ€‹

Section | undefined


๐Ÿท๏ธ typeโ€‹

Retrieves the section type, which can be one of the following values:

  • section: The section is a regular section;
  • branch: The section serves as a branch;
  • nest: The section holds a nested branch (subform).

Typeโ€‹

"section" | "branch" | "nest"


๐Ÿท๏ธ versionโ€‹

Sets or retrieves a version indicator for a section that is a nested branch (subform). This property can be used to track the origin of a subform when it was loaded from an external source. For example, the version number of a subform can be stored in this property.

Typeโ€‹

string

tip

See the Subforms guide for more information.

โ–ถ๏ธ Methodsโ€‹


๐Ÿ”ง convertToBranchโ€‹

Converts a section to a branch.

Signatureโ€‹

convertToBranch(): boolean

Return valueโ€‹

Returns true if the conversion was successfully.


๐Ÿ”ง convertToSectionโ€‹

Convert a (nested) section back to a regular section.

Signatureโ€‹

convertToSection(): boolean

Return valueโ€‹

Returns true if the conversion was successfully.


๐Ÿ”ง convertToNestedBranchโ€‹

Converts a section to a nested branch.

Signatureโ€‹

convertToNestedBranch(): void

๐Ÿ”ง deleteโ€‹

Deletes a section from the Sections collection.

Signatureโ€‹

delete(): this

Return valueโ€‹

Returns a reference to the deleted Section.


๐Ÿ”ง duplicateโ€‹

Duplicates the section.

Signatureโ€‹

duplicate(): Section

Return valueโ€‹

Returns a reference to the duplicated Section.


๐Ÿ”ง extractโ€‹

Extracts a nested branch to the parent form.

Signatureโ€‹

extract(): boolean

Return valueโ€‹

Returns true if the subform was extracted successfully.


๐Ÿ”ง insertAfterโ€‹

Inserts a new section after this section.

Signatureโ€‹

insertAfter(): Section

Return valueโ€‹

Returns a reference to the new Section.


๐Ÿ”ง insertBeforeโ€‹

Inserts a new section before this section.

Signatureโ€‹

insertBefore(): Section

Return valueโ€‹

Returns a reference to the new Section.


๐Ÿ”ง insertBranchAfterโ€‹

Inserts a new branch section after this section.

Signatureโ€‹

insertBranchAfter(): [Branch, Section]

Return valueโ€‹

Returns a reference to the new branch and section.


๐Ÿ”ง insertBranchBeforeโ€‹

Inserts a new branch section before this section.

Signatureโ€‹

insertBranchBefore(): [Branch, Section]

Return valueโ€‹

Returns a reference to the new branch and section.


๐Ÿ”ง insertNestedBranchAfterโ€‹

Inserts a new nested branch section after this section.

Signatureโ€‹

insertNestedBranchAfter(): [Branch, Section]

Return valueโ€‹

Returns a reference to the new branch and section.


๐Ÿ”ง insertNestedBranchBeforeโ€‹

Inserts a new nested branch section before this section.

Signatureโ€‹

insertNestedBranchBefore(): [Branch, Section]

Return valueโ€‹

Returns a reference to the new branch and section.


๐Ÿ”ง loadNestedBranchโ€‹

Loads a nested branch (subform).

info

You can only load nested branches (subforms) to sections of type nest.

Signatureโ€‹

loadNestedBranch(
definition: IDefinition,
reference?: string,
version?: string,
alias?: string,
readonly?: boolean
): boolean

Parametersโ€‹

NameTypeOptionalDescription
definitionIDefinitionNoSpecifies the definition to load as subform.
referencestringYesSpecifies an optional reference to store.
versionstringYesSpecifies an optional version identifier.
aliasstringYesSpecifies an optional alias for the subform.
readonlybooleanYesSpecifies if the subform is read-only.

Return valueโ€‹

Returns true if the subform was loaded succesfully.

tip

See the Subforms guide for more information.


๐Ÿ”ง moveToIndexโ€‹

Moves the section to the specified index.

Signatureโ€‹

moveToIndex(index: number): boolean

Parametersโ€‹

NameTypeOptionalDescription
indexnumberNoSpecifies the new index position for the section where the first section is 0.

Return valueโ€‹

Returns true if the move succeeded.


๐Ÿ”ง moveToNestedBranchโ€‹

Moves the section to a nested branch (subform).

Signatureโ€‹

moveToNestedBranch(section: Section): boolean

Parametersโ€‹

NameTypeOptionalDescription
sectionSectionNoSpecifies the section to move the section to.

Return valueโ€‹

Returns true if the section was moved succesfully.


๐Ÿ”ง moveToParentโ€‹

Moves the section to the parent form if it is in a nested branch (subform).

Signatureโ€‹

moveToParent(): boolean

Return valueโ€‹

Returns true if the section was moved succesfully.


๐Ÿ”ง moveUpOrDownโ€‹

Moves the section up or down.

Signatureโ€‹

moveUpOrDown(up: boolean): boolean

Parametersโ€‹

NameTypeOptionalDescription
upbooleanNoSpecifies if the move direction is up (true) or down (false).

Return valueโ€‹

Returns true if the move succeeded.


๐Ÿ”ง rerenderโ€‹

Invokes a rerendering of the section.

Signatureโ€‹

rerender(type: "refresh" | "update"): void

Parametersโ€‹

NameTypeOptionalDescription
type"refresh" | "update"NoSpecifies the rerender type. It can be one of the following values:
- refresh: Refresh the whole rendering (slower);
- update: Updates the rendering (faster).

๐Ÿ”ง resetโ€‹

Resets the section and removes all content in the section.

Signatureโ€‹

reset(): void

๐Ÿ”ง swapโ€‹

Swaps the section with another section.

Signatureโ€‹

swap(with: Section): boolean

Parametersโ€‹

NameTypeOptionalDescription
withSectionNoSpecifies the section to swap with.

Return valueโ€‹

Returns true if the swap succeeded.