tbbooher / journal

0 stars 0 forks source link

need to have updates working with autoform #24

Open tbbooher opened 9 years ago

tbbooher commented 9 years ago

the current form submits, but needs to update as well. cf. the below:

Can I reuse the same quickForm or autoForm for both inserts and updates?

Yes. Your code that flips between states should do the following in this order:

Change the type attribute's value to "insert" or "update" as appropriate, probably by updating a reactive variable. Change the doc attribute's value to the correct document for an update or to null (or a document containing default values) for an insert, probably by updating a reactive variable. Call AutoForm.resetForm(formId). This will clear any existing validation errors for the form.

tbbooher commented 9 years ago

working on this next, because this is critical function needed for the other issues.