django-admin-sortable2 icon indicating copy to clipboard operation
django-admin-sortable2 copied to clipboard

Feature request: Move to top/bottom buttons

Open tbdaniel27 opened this issue 3 years ago • 5 comments

We are maintaining very long lists of items using admin-sortable2. Unfortunately, new items are always added to the bottom. However, in our data domain, new items should appear on top most of the time.

This is a problem for our users because they need to add new items quite often and each time they have to move them via drag'n'drop through the whole list to the top.

Is there a way to place new items to the top directly or at least show a move to top/move to bottom button on each row?

tbdaniel27 avatar Mar 02 '22 07:03 tbdaniel27

Unfortunately, new items are always added to the bottom.

You mean new items added using the object's detail view? You're talking about the normal admin views, not inline-admins?

This is a problem for our users because they need to add new items quite often and each time they have to move them via drag'n'drop through the whole list to the top.

So your users save the object and then in the list view, they have to move the just created object to the top. Interesting idea. Yes, I believe it is possible by adding a special input field to the object's detail view. This would then influence the behavior of how a new object is inserted into the list of objects.

jrief avatar Mar 02 '22 08:03 jrief

You mean new items added using the object's detail view? You're talking about the normal admin views, not inline-admins?

In my case it's actually the inline admin. Sorry for not having been clear about this.

So your users save the object and then in the list view, they have to move the just created object to the top.

Yes, or at least, this is a workaround I came up with. Basically, new items need to go to the top. I'm not sure what the best approach for this would be.

tbdaniel27 avatar Mar 02 '22 12:03 tbdaniel27

If I add this feature, I think it also should handle plain objects, not only inlines. All in all, I don't think it's going to be too difficult to add.

Are you able to fund this feature request?

jrief avatar Mar 02 '22 13:03 jrief

Are you able to fund this feature request?

Well, what exactly do you suggest?

tbdaniel27 avatar Mar 03 '22 10:03 tbdaniel27

If your company can fund this feature, I can implement it quickly. Otherwise you have to wait until I need it myself. Please contact me on my private email for details.

jrief avatar Mar 03 '22 10:03 jrief

Thanks to Tonies for funding this feature. It has been implemented in version 2.1.

jrief avatar Aug 11 '22 21:08 jrief