Handels inline formsets created by django crispy forms. Works also as stand alone without crispy form management.

  • Add to the slot "management" the crispy management form.
  • Add to the slot "empty" the empty form.

Initial formsets must each wrapped by an element of the type "parentTag" with the class "parentClass".

Properties

announcementAdded: string = 'Eingabefelder eines weiteren Formularsets vor dem Button hinzugefügt'

Text which gets announced in screen readers when a new formset got added.

announcementRemoved: string = 'Eingabefelder des Formularsets entfernt'

Text which gets announced in screen readers when a formset got removed.

maxNumForms: number

The maximum amount of formsets. Gets set/overwritten when a crispy management form is provided.

minNumForms: number = 0

The minimum amount of formsets. Gets set/overwritten when a crispy management form is provided.

parentClass: string = 'formset-form'

The class which the parent element will get.

parentTag: string = 'div'

The parent tag name which will wrap a newly created formset.

replacement: string = '__prefix__'

The string which gets replaced by the index in the added empty formset.

The replacement string must also enclosed in "-" characters. E.g. the replacment string is "prefix", than a name of an element must be "event_institutio-prefix-date". Note the "-" in front and after "prefix".

Also the id and the name of an element must NOT contain "-"+number+"-".

Also properties of hylo components which reference ids need to be set as attributes instead of properties in order to get replaced. E.g. <element input-id="..."/> instead of element.inputId="..."

textAddButton: string = 'Weiteres Formularset hinzufügen'

Text of the add button.

textBeginningMarker: string = 'Anfang eines Formularsets'

Text of a hidden label which marks the beginning of a formset.

textEndingMarker: string = 'Ende des Formularsets'

Text of a hidden label which marks the ending of a formset.

textRemoveButton: string = 'Formularset entfernen'

Text of the remove button.

totalForms: number

The total amount of formsets. Gets set/overwritten when a crispy management form is provided.

Methods

  • Adds another formset.

    Returns Promise<void>

  • Removes the last formset or the one of the giving index.

    Parameters

    • index: number = null

    Returns Promise<void>

Events

hyloInlineFormsetAdded: EventEmitter<HTMLElement>

A new formset got added. Provides the added formset.

hyloInlineFormsetRemoved: EventEmitter<HTMLElement>

A formset got removed. Provides the removed formset.

Generated using TypeDoc