Javascript for prototype
Opened this issue · 3 comments
In my form called "spot", i have an "availabilities" collection, every item in this collection is an AvailabilityType wich contains a few fields. One of them, "startAt" need javascript for its datepicker.
I tried the solution given in the documentation :
{{ form_javascript(form.availabilities.vars.prototype, true) }}
but twig is looking for a block who does not exist :
Unable to render the form as none of the following blocks exist: "_spot_availabilities_entry_javascript_prototype", "availability_javascript_prototype", "form_javascript_prototype".
Am i doing something wrong or is my case not covered by the given workaround ?
I am also having this same problem but for 'genemu_jqueryselect2_entity'.
Works fine for original loaded form but after clicking 'Add' the new 'Select' field is just a bog standard drop down not a search type. Have tried every possible combination of the provided guides but cannot for the life of me find how to make it work?
I had the same issue and I fixed it by adding in the new row javascript this:
{{ form_javascript(form.myCollection.vars.prototype.mySelect2Field, true) }}
This is the documentation link I am refering to: https://github.com/genemu/GenemuFormBundle/blob/master/Resources/doc/tips/form_prototype.md
did you also have to resolve the variable $field
?