Closed soeren-helbig closed 10 years ago
Hi @soeren-helbig ,
Yes you're right, you should now use {{ afe_form_javascript(form) }}
i discovered the additional js-initialization is not done
Could you please precise "js-initialization is not done". What did you expect? What do you have?
Thank you for your contribution,
Hey @sescandell ,
sry, of course this information is important ;) i expected the following script-tag to be rendered
<script>
$(FORM_TYPE).select2()
</script>
but in my case this does not happen. instead the twig extension {{ afe_form_javascript(form) }}
returns a empty value.
Ok,
I'll check prototype integration this afternoon.
Keep in touch...
nice, thx!
I think that for some reason the block _afe_select2_afejavascript contained on file form_javascripts.html.twig (starts at line 319) is not being rendered. Unfortunately I was not able to find the what's causing it for this specific block. :( I believe this was working fine before the "afe_" prefix renaming..
Changing the block name as follows solves the issue although I'm not sure if that's the best solution to apply here...
{% block afe_select2_entity_afe_javascript %}
{% spaceless %}
{% autoescape false %}
<script type="text/javascript">
jQuery(document).ready(function($) {
$field = $('#{{ id }}');
{% block afe_select2_afe_javascript_prototype %}
$field.select2({{ configs|e4js }});
{% endblock afe_select2_afe_javascript_prototype %}
});
</script>
{% endautoescape %}
{% endspaceless %}
{% endblock afe_select2_entity_afe_javascript %}
Would replicating this block for each select2_* (much like it's done for double_list related blocks on this same file) be an acceptable solution?
Meanwhile I think I've found what's really causing the problem... I'll submit a PR.
Closed thanks to #96
hey there, i used select2_entity before prefix-refactoring. now i updated my vendors, and the afe_select2_entity type stopped working. after a little try, i discovered the additional js-initialization is not done. please, tell me if i am wrong, shouldn`t this be done by the following twig-function:
my javascript block: