ReadOnlyFormCollection - Andrei15193/react-model-view-viewmodel GitHub Wiki
API / ReadOnlyFormCollection<TForm, TValidationError> class
Represents a configurable read-only observable collection of form sections. 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 ReadOnlyObservableCollection<TForm>.
Implements IReadOnlyFormCollection<TForm, TValidationError>, IValidatable<TValidationError>.
class ReadOnlyFormCollection<TForm extends Form<TValidationError>, TValidationError = string>
extends ReadOnlyObservableCollection<TForm>
implements IReadOnlyFormCollection<TForm, TValidationError>, IValidatable<TValidationError>
Source reference: src/forms/ReadOnlyFormCollection.ts:16
.
-
TForm - The concrete type of the form section.
Type constraints: Form<TValidationError>.
-
TValidationError - The concrete type for representing validation errors (strings, enums, numbers etc.).
Default value:
string
.
-
constructor - Initializes a new instance of the
ReadOnlyFormCollection<TForm, TValidationError>
class.
- error - Gets or sets the error message when the object is invalid.
- isInvalid - A flag indicating whether the object is invalid.
- isValid - A flag indicating whether the object is valid.
-
readonly
validation - Gets the validation configuration for the form. Fields have their own individual validation config as well. -
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
length - Gets the number of items in the collection. -
inherited
propertiesChanged - An event that is raised when one or more properties may have changed.
- clearItemSetups - Clears all setup callbacks and resets all existing form sections.
- reset - Resets the form, contained fields and sections to their initial configuration.
-
withItemSetup - Configures the provided
setupCallback
and applies it on all existing form sections within the collection -
withoutItemSetup - Removes the provided
setupCallback
and no longer applies it to form sections that are added, all existing -
protected
onSectionChanged - Invoked when a section's properies change, this is a plugin method through which notification propagation can be made with ease. -
protected
onShouldTriggerValidation - Invoked when the current instance's properties change, this is a plugin method to help reduce validations when changes do not
-
ViewModel
-
ReadOnlyObservableCollection<TItem>
- ObservableCollection<TItem>
- ReadOnlyFormCollection<TForm, TValidationError>
- ReadOnlyObservableSet<TItem>
- ReadOnlyObservableMap<TKey, TItem>
- Validatable<TValidationError>
-
ReadOnlyObservableCollection<TItem>