浏览代码

fix JS unselect many_association

Charley Maillot 14 年之前
父节点
当前提交
ca5a62a0c0
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Resources/views/CRUD/edit_orm_many_association_script.html.twig

+ 4 - 0
Resources/views/CRUD/edit_orm_many_association_script.html.twig

@@ -333,6 +333,10 @@ This code manage the many-to-[one|many] association field popup
         function field_remove_element_{{ id }}(event) {
             event.preventDefault();
 
+            if (jQuery('#{{ id }} option').get(0)) {
+                jQuery('#{{ id }}').attr('selectedIndex', '-1').children("option:selected").attr("selected", false);
+            }
+            
             jQuery('#{{ id }}').val('');
             jQuery('#{{ id }}').trigger('change');