genemu / GenemuFormBundle

Extra Form : Captcha GD, Tinymce, Recaptcha, JQueryDate, JQueryAutocomplete, JQuerySlider, JQueryFile, JQueryImage
587 stars 263 forks source link

Javascript for prototype #333

Open jcrombez opened 10 years ago

jcrombez commented 10 years ago

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 ?

DougHayward commented 10 years ago

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?

Schyzophrenic commented 10 years ago

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

thedamnedrhino commented 9 years ago

did you also have to resolve the variable $field?