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

Sortable Multichoice field #85

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kunalgrover05
Copy link

I have modified the default form widget to enable sorting of data which is added into our DB. This PR makes this behavior default since I am not sure if there is any disadvantage of doing that.

This adds an extra dependency of JQuery UI library: https://jqueryui.com/
Possibly, any other simple JS library can replace the JQuery UI module.

Behavior

  • All list of items are sortable. Since there is no change in how the DB stuff is handled, only sorting of the selected items will be saved.
  • When the form is reloaded, all selected items show on top in sorted order, and unselected items go at bottom(in the same order they are defined).
  • When sorting is changed, the form is marked as dirty and saved again. This is a change from the current behavior.

PS: I am unsure of my sorting technique by overriding optgroups function. Any advise is welcome.

@tomasgarzon
Copy link
Collaborator

Hi, could you update from master?

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

Successfully merging this pull request may close these issues.

2 participants