Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

Reorder token with drag and drop #236

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

Conversation

David-Desmaisons
Copy link

This pull request introduces the ability to use drag and drop to reorder token (associated issue: #59 ).
To enable this behaviour, use the option {sortable: true}.
Two new events have been created 'tokenfield:sorttoken' and 'tokenfield:sortedtoken' both receiving the same option event argurment with the following attribute: attrs: attributes of the token been moved, oldPosition: old position in the list, newPosition: new position in the list.
It is possible cancel drag and drop in the 'tokenfield:sorttoken' event by doing return false or calling event.preventDefault().
The implementation uses jquery sortable plugin so you need to include jquery.ui to make it work.

@horacepan
Copy link

Are there plans to have this merged into master?

@firstthumb
Copy link

I am waiting for this feature.

@crowezie
Copy link

Ya this would be great to have

@manojLondhe
Copy link

+1 Maintainers will you please review and merge this one?

@manojLondhe
Copy link

@David-Desmaisons Try sending PR to these guys https://github.com/Open-Xchange-Frontend/bootstrap-tokenfield
They seem to have lots of work going on this plugin. What say @dotcore ?

@David-Desmaisons
Copy link
Author

@manojLondhe thanks for the suggestion. I am quite busy right now with other projects but I may take some time in the future to submit the PR to https://github.com/Open-Xchange-Frontend/bootstrap-tokenfield

@crowezie
Copy link

crowezie commented Apr 6, 2016

@David-Desmaisons I was playing with this in a rails project and the sorting of tokens works great, but when I submit my tokenfield form they aren't saved in their new positions. Do I need to actually store the position to make it work?

@David-Desmaisons
Copy link
Author

@crowezie I will have to check. It has been one year since I submit this PR! I may have some time this week-end to check the issue.

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

Successfully merging this pull request may close these issues.

5 participants