pix-digital / pixSortableBehaviorBundle

Offers a sortable feature for your Symfony2 admin listing
MIT License
46 stars 78 forks source link

Starting count for position #39

Open themao opened 8 years ago

themao commented 8 years ago

I've noticed another strange behavior of this bundle: it uses counter that starts from 0, while SonataAdminBundle's javascript, which is used by 'sonata_type_collection' (admin that's embedded inside another admin) starts counting from 1. In the end it makes collisions: items are ordered like 1,2,3 - so the top position is never reached.

I've made a workaround for this in my current project, but I think it would be handy to provide a generic solution: make a config parameter like 'counter_start' which will be an integer and will indicate where to start counting from.

What do you think about this extension?

Tofandel commented 7 years ago

Noticed that too, when the start position is not 0, you get an odd behavior when sorting. (Elements move where they shouldn't)

tonyellow commented 4 years ago

I've noticed another strange behavior of this bundle: it uses counter that starts from 0, while SonataAdminBundle's javascript, which is used by 'sonata_type_collection' (admin that's embedded inside another admin) starts counting from 1. In the end it makes collisions: items are ordered like 1,2,3 - so the top position is never reached.

I've made a workaround for this in my current project, but I think it would be handy to provide a generic solution: make a config parameter like 'counter_start' which will be an integer and will indicate where to start counting from.

What do you think about this extension?

Can you please explain what you exactly did to make it work?

dmitryuk commented 2 years ago

Sonata admin officially migrated to runroom-packages/sortable-behavior-bundle, try it instead. https://symfony.com/bundles/SonataAdminBundle/current/cookbook/recipe_sortable_listing.html