Parcourir la source

Fix #42 - sortable column must be named position

Thomas Rabaix il y a 13 ans
Parent
commit
93298ce78d
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      Resources/views/CRUD/edit_orm_one_to_many.html.twig

+ 2 - 2
Resources/views/CRUD/edit_orm_one_to_many.html.twig

@@ -107,14 +107,14 @@ file that was distributed with this source code.
 
 
                     function apply_position_value_{{ id }}() {
                     function apply_position_value_{{ id }}() {
                         // update the input value position
                         // update the input value position
-                        jQuery('div#field_container_{{ id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ id }}-position').each(function(index, element) {
+                        jQuery('div#field_container_{{ id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ id }}-{{ sonata_admin.field_description.options.sortable }}').each(function(index, element) {
                             // remove the sortable handler and put it back
                             // remove the sortable handler and put it back
                             jQuery('span.sonata-ba-sortable-handler', element).remove();
                             jQuery('span.sonata-ba-sortable-handler', element).remove();
                             jQuery(element).append('<span class="sonata-ba-sortable-handler ui-icon ui-icon-grip-solid-horizontal"></span>');
                             jQuery(element).append('<span class="sonata-ba-sortable-handler ui-icon ui-icon-grip-solid-horizontal"></span>');
                             jQuery('input', element).hide();
                             jQuery('input', element).hide();
                         });
                         });
 
 
-                        jQuery('div#field_container_{{ id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ id }}-position input').each(function(index, value) {
+                        jQuery('div#field_container_{{ id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ id }}-{{ sonata_admin.field_description.options.sortable }} input').each(function(index, value) {
                             jQuery(value).val(index + 1);
                             jQuery(value).val(index + 1);
                         });
                         });
                     }
                     }