Skip to content

FormCollection

github-actions[bot] edited this page Dec 3, 2024 · 3 revisions
API / FormCollection<TForm, TValidationError> class

Represents a configurable observable collection of forms. Callbacks can be configured for setting up individual form sections for cases where validation and other aspects are based on the state of an entity or the form itself.

Extends ReadOnlyFormCollection<TForm, TValidationError>.
Implements IFormCollection<TForm, TValidationError>.

class FormCollection<TForm extends Form<TValidationError>, TValidationError = string>
    extends ReadOnlyFormCollection<TForm, TValidationError>
    implements IFormCollection<TForm, TValidationError>

Source reference: src/forms/FormCollection.ts:14.

Generic Parameters

  • TForm - The concrete type of the form.

    Type constraints: Form<TValidationError>.

  • TValidationError - The concrete type for representing validation errors (strings, enums, numbers etc.).

    Default value: string.

Constructors

Properties

  • override length - Gets or sets the number of items in the collection.
  • inherited readonly collectionChanged - An event that is raised when the collection changed by adding or removing items.
  • inherited readonly collectionReordered - An event that is raised when the collection is reordered.
  • inherited error - Gets or sets the error message when the object is invalid.
  • inherited isInvalid - A flag indicating whether the object is invalid.
  • inherited isValid - A flag indicating whether the object is valid.
  • inherited propertiesChanged - An event that is raised when one or more properties may have changed.
  • inherited readonly validation - Gets the validation configuration for the form. Fields have their own individual validation config as well.

Methods

  • override copyWithin - Copies items inside the collection overwriting existing ones.
  • override fill - Fills the collection with the provided item.
  • override get - Gets the item at the provided index.
  • override pop - Removes the last element from the collection and returns it. If the collection is empty, undefined is returned.
  • override push - Appends new elements to the end of the collection, and returns the new length of the collection.
  • override reverse - Reverses the items in the collections and returns the observable collection..
  • override set - Sets the provided item at the provided index.
  • override shift - Removes the first element from the collection and returns it. If the collection is empty, undefined is returned.
  • override sort - Reverses the items in the collections and returns the observable collection.
  • override splice - Removes and/or adds elements to the collection and returns the deleted elements.
  • override unshift - Inserts new elements at the start of the collection, and returns the new length of the collection.

Inheritance Hierarchy

See also

Clone this wiki locally