Browse Source

fix JS unselect many_association

Charley Maillot 14 years ago
parent
commit
ca5a62a0c0
1 changed files with 4 additions and 0 deletions
  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');