瀏覽代碼

Fixed the triggering of the "sonata.add_element" event.

Henrik Westphal 13 年之前
父節點
當前提交
63b2dfd2b1
共有 1 個文件被更改,包括 2 次插入4 次删除
  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",
             type: "POST",
             data: { _xml_http_request: true },
             data: { _xml_http_request: true },
             success: function(html) {
             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');
             }
             }
         });
         });