sonata-project/SonataDoctrineORMAdminBundle — Issue #42: sortable column must be named position
Author: adavea
Created: 2012-02-16 17:57:50+00:00
State: open

If you don't name your sort-by column "position", drag-droppable lists do not display correctly. edit_orm_one_to_many.html.twig (line 105 currently) has a sortable column of 'position' hard coded in to the javascript. Instead of 'position' it should really sort by whichever field is specified in configureFormFields().

$formMapper
->add('code')
->add('enabled')
->add('name')
->add('defaultFormat')
->add('galleryHasMedias', 'sonata_type_collection', array(), array(
'edit' => 'inline',
'inline' => 'table',
'sortable' => 'position' //<====drag-dropping only works if you specify "position" here, no other field name works
))
;