Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List items reordering (draggable) #106

Open
eduard-sukharev opened this issue Jan 9, 2021 · 0 comments
Open

List items reordering (draggable) #106

eduard-sukharev opened this issue Jan 9, 2021 · 0 comments

Comments

@eduard-sukharev
Copy link

Is your feature request related to a problem? Please describe.
Pre-sorting things before showing them to user is a really ubiquitous use case. Menu items, package types, filters priority, managers queue etc. usually should be fetched from DB and shown in UI in some pre-defined order. Usually, this is done with the help of additional column, e.g. sort_order or priority.

Describe the solution you'd like
A table or a list with drag-n-drop capability would be perfect. All items are shown in the order defined by sorting column (e.g. priority). If the order is not defined (no field present or duplicate values) then initial order in the list is undefined, but persisted as soon as it makes sense (e.g. for duplicate values - increment on of the two and recalculate all the following values in the list to become +1 and then call update for each item).
When item is dragged into different position, then sorting value should be updated for all items between it's new position (including item itself) and previous position.
De-bouncing and batching updates might help here.

Describe alternatives you've considered
Having sorting buttons are ok too (see screenshot)
photo_2021-01-07_13-48-12
Upon each button click the two models that have switched places should be updated. De-bouncing calls might be an option here, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant