Closed syeo66 closed 8 years ago
Thanks for reporting this @syeo66 !
Can you please compare the html in both cases, and find the template(s) involved? They should appear in the symfony profiler, or maybe just use grep
to find them. Also, you kind find the profile for the ajax query in the symfony profiler by using the built-in form there is.
Well, I tried to find as many information as I could. The HTML (extracted from Chromes inspector - so after any Javascript-Processing took place) looks like this at first (correct version):
<td class="sonata-ba-td-s57ea5dfdce73a_normtables-_delete">
<div class="checkbox">
<label>
<div class="icheckbox_square-blue">
<input type="checkbox" id="s57ea5dfdce73a_normtables_0__delete" name="s57ea5dfdce73a[normtables][0][_delete]" value="1" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;">
</ins>
</div>
<span class="control-label__text">Delete</span>
</label>
</div>
</td>
The code after the Ajax call looks like this:
<td class="sonata-ba-td-s57ea5dfdce73a_normtables-_delete">
<div class="checkbox">
<label>
<input type="checkbox" id="s57ea5dfdce73a_normtables_0__delete" name="s57ea5dfdce73a[normtables][0][_delete]" value="1">
<span class="control-label__text">Delete</span>
</label>
</div>
</td>
The involved templates are in both cases those two: SonataDoctrinePHPCRAdminBundle:CRUD:edit_phpcr_one_to_many.html.twig SonataDoctrinePHPCRAdminBundle:CRUD:edit_phpcr_one_association_script.html.twig
However it really seems as if the iCheck script needs to get called again after retrieving the content by ajax.
(For some reason I can't make the HTML-Code to show up correctly) html_examples.txt
Environment
Sonata packages
Symfony packages
PHP version
Subject
Checkboxes do look odd after Ajax-call when using sonata_type_collection inline-tables.