-
Notifications
You must be signed in to change notification settings - Fork 230
Reorder token with drag and drop #236
base: master
Are you sure you want to change the base?
Conversation
Are there plans to have this merged into master? |
I am waiting for this feature. |
Ya this would be great to have |
+1 Maintainers will you please review and merge this one? |
@David-Desmaisons Try sending PR to these guys https://github.com/Open-Xchange-Frontend/bootstrap-tokenfield |
@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 |
@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? |
@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. |
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 doingreturn false
or callingevent.preventDefault()
.The implementation uses jquery sortable plugin so you need to include jquery.ui to make it work.