Reading the Docs the first time is hard. For example the quickstart guide mentions the concepts of modelReducers and formReducers without any references on what they are, how they are useful or why they are separate things. A lot of references are broken and I find it pretty hard to gather the information needed, so please bear with me if I ask something seemingly trivial.
I want to create a form where the model has the following structure:
{
groups: [
{
groupId: 123
groupName: 'personal parameters',
items: [
{
id: 12,
displayName: 'First Name',
type: 'text',
value: 'John'
},
{
id: 13,
displayName: 'Weight',
type: 'number',
value: 100,
unit: 'kg'
}
]
}
]
}
The requirements for this form:
...createForms({ personForm }) I guess)track() but with a depth of 2. What actions to dispatch to manipulate order and adding/deleting new groups?).<select> dom element is only visible and the property should be only sent to the server on submit) if the type is 'number'. (Showing and hiding form elements depending on form state. How do I access the form state?)I'm not requiring a full blown example on this (although I'm pretty sure it would be useful for others), but at least pointers on how to solve each requirement.
Also I'm really interested in how to properly compose this (How can I split and compose the reducers or the components? Should I create a GroupItemEditor component or better to just use a map directly in the main component?)
I would really appreciate even partial help on this.
It will be appreciated if anyone can provide or point out the following examples:
Most helpful comment
It will be appreciated if anyone can provide or point out the following examples:
Thanks.