Data API
Like Formula, beaker
returns an instance of the Beaker stores which are have the same name as
the Formula store, but container Array of form data as rows. The exceptions are
isFormReady
and isFormValid
which are for the entire group and still a single value.
It also contains some additional properties and methods. The methods listed below allow for data to be added or removed
from the groups formValue
store - this store can also be used with a {#each}
block to render the rows in the
template.
init
#
Pass initial data into the form group, or reset the form to initial data - this will the form store data with the
current items to render. Each key and value should match the fields in the group template (the exception
is radio fields which should be based on the data-formula-name
attribute passed).
add
#
Add a row item to the store - this item should be a single object with the same key/value type for the form.
set
#
Update an existing row in the store at the passed index.
delete
#
Deletes a row from the form - this method takes the index of the row to remove.
clear
#
Calling this will empty the group of all rows of data.
forms
#
An Map
of all the underlying Formula instances that allows for finer control, or access to the form
stores