formex v0.5.3 Formex.FormCollection
Form collections
To get started see Formex.Type
, section Collections of forms.
Functionality that are not mentioned in the link above:
Options
type
- module that implementsFormex.Type
. Requiredstruct_module
- module of struct, e.g.App.UserAddress
delete_field
- defaults to:formex_delete
. Defines input that will be set to true if we click ×. Behaviours depends on value::formex_delete
- ifformex_delete
is true, this collection item will be removed.another field - it’s a simple input that may be stored in repo
For example, we can in our model create
removed
field. Then setdelete_field: :removed
option.
Summary
Types
Functions
finish_creating(form, form_collection)
finish_creating(form :: Formex.Form.t, form_collection :: Formex.FormCollection.t) :: Formex.Form.t
start_creating(form, type, name, opts)
start_creating(form :: Formex.Form.t, type :: any, name :: Atom.t, opts :: Map.t) :: Map.t
to_be_removed(form_collection, form_nested)
to_be_removed(form_collection :: t, form_nested :: Formex.FormNested.t) :: boolean