You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like the gem, but currently it seems impossible to trigger the insertion of the nested form from JS. Of course I can trigger the click event on the button from JS but that will not give me the inserted fields list back, and it has anyway a bad code smell.
Can you maybe merge #290 pullrequest? I would give a muchcleaner JS API to cocoon.
The text was updated successfully, but these errors were encountered:
Antronin
changed the title
Add nested form with JS call is impossible
Add nested form with JS call is impossible in a clean way
Jun 13, 2017
Hi!
The use case: I have an image where I can select (via mous selection) multiple areas and I'm storing the coordinates in nested form fields. When I add a new fieldset via cocoon, I can create a selection on the image using the after-create callback.
But I can do it in the opposite way: I make aselection on the image which should result in the creation of a nested form set with the coordinates of the selection in them.
This later part is problematic, because there is no way of initiate the field set creation through JS. The only way I can think of is triggering the "click" event on the button, but that will trigger the after-create event too, which will duplicate my original selection.
Hi!
I really like the gem, but currently it seems impossible to trigger the insertion of the nested form from JS. Of course I can trigger the click event on the button from JS but that will not give me the inserted fields list back, and it has anyway a bad code smell.
Can you maybe merge #290 pullrequest? I would give a muchcleaner JS API to cocoon.
The text was updated successfully, but these errors were encountered: