Currently the only way to add an item to a nested form is to trigger the click event on the add link.
Cocooned introduces referencing its own instance as a (jQuery) data attribute on the items container. Hence, it is theoretically possible to get that instance and call its add method to add a new item to the form. But the add method expect the add link and an event as arguments.
Cocooned should expose a clean interface to manipulate items in a nested form.
Originaly suggested in nathanvda/cocoon#431
Currently the only way to add an item to a nested form is to trigger the click event on the add link.
Cocooned introduces referencing its own instance as a (jQuery) data attribute on the items container. Hence, it is theoretically possible to get that instance and call its
addmethod to add a new item to the form. But theaddmethod expect the add link and an event as arguments.Cocooned should expose a clean interface to manipulate items in a nested form.
Originaly suggested in nathanvda/cocoon#431