Browse Source

Merge pull request #33 from snc/patch-1

Fixed the triggering of the "sonata.add_element" event.
Thomas 13 years ago
parent
commit
691771e184
1 changed files with 2 additions and 4 deletions
  1. 2 4
      Resources/views/CRUD/edit_orm_one_association_script.html.twig

+ 2 - 4
Resources/views/CRUD/edit_orm_one_association_script.html.twig

@@ -41,10 +41,8 @@ This code manage the one-to-many association field popup
             type: "POST",
             data: { _xml_http_request: true },
             success: function(html) {
-                jQuery('#field_container_{{ id }}')
-                    .replaceWith(html) // replace the html
-                    .trigger('sonata.add_element')
-                ;
+                jQuery('#field_container_{{ id }}').replaceWith(html); // replace the html
+                jQuery('#sonata-ba-field-container-{{ id }}').trigger('sonata.add_element');
             }
         });