Closed ghost closed 10 years ago
Hi,
what is that fix for ?
+1 to @Molkobain
I get normal radio buttons without this class. Am I doing something wrong ?
It's working ok for me without touching anything, maybe you have forget something in your code. Would you like to post it here so we could take a look ?
Sure, so I'm using sonata sandbox and I'm including this in the comment section of the ecommerce product page. My formtype is something like .
$builder->add(
'note',
'genemu_jqueryrating',
array(
'required' => false,
'configs' => array(
'readOnly' => true
),
'choices' => $this->noteProvider->getValues()
)
);
and the twig is
{{ form_label(form.note, 'form_label_note'|trans({}, 'SonataCommentBundle'), {'horizontal_label_class': ''}) }}
{{ form_widget(form.note) }}
...
<script src="{{ asset('/bundles/bundleName/js/jquery-ui.min.js') }}"></script>
<script src="{{ asset('/bundles/bundleName/js/jquery.rating.pack.js') }}"></script>
the jquery.rating.css is included in the template also
with the attr I included in the pr the widget works like a charm, without it, plain old radio buttons .
Try to call the genemu javascript part by adding {{form_javascript(form)}}
that was my problem thank you
Glad it helped :)
Regarding which part of Genemu you are using, you might also need the {{form_layout(form)}}
for the HTML parts and/or the {{form_stylesheets(form)}}
for the CSS parts
More informations here : https://github.com/genemu/GenemuFormBundle/blob/master/Resources/doc/template.md
class was missing in the form widget