Open ssteinerx opened 9 years ago
+1
This might help:
Template.afModal.events
'click *': (e, t) ->
e.preventDefault()
if (t.data.formId == "itemForm")
Session.set 'itemId', t.parent().parent().data._id
The you can access the session variable in your auto form hook.
AutoForm.hooks
itemForm:
before: insert: (doc, template) ->
doc.itemId = Session.get('itemId')
doc
I can only figure out which record I'm editing by calling a function that traverses the DOM.
How can I get that function injected to provide context for the form?