Conversation
jQueryUI is required for this. If it is not loaded, the sortable option will be deactivated automatically.
# Conflicts: # js/jquery.multi-select.js
|
We are very interested in seeing this PR merged in. We are currently using the fork version by the original PR submitter. Thank you so much @Mactory ! |
|
Is this fork still available. |
|
@christianmagill We took the changes from here: https://github.com/NB-Dev/multi-select/ |
|
Much thanks! |
|
I merged the newest upstream master into my repo as this PR has not yet been merged. |
|
@Mactory thanks for updating your PR. Really looking forward for this to get into master. |
|
@Mactory, This PR suffers from a jQuery UI Sortable bug in Firefox (Mac/Win). Dragging and releasing sends a click which in this context unselects the dragged selection. Apparently the solution is to use the Sortable option helper : 'clone' I have yet to confirm this fix. |
This commit solves an issue with jQuery UI where dragging an item causes a click event which results in the item being deselected.
jQuery UI Sortable "Clone" Helper for Firefox Issues.
|
Is there a way to style the handle / cursor on the selection side only? I want to keep the pointer on the left but on the right, when sorting is available, id like it to be a move icon. |
|
@carlhussey Yes, you can use CSS for this: |
|
@Mactory I think that seems to be a reasonable addition. |
|
@Mactory does this also fire an event when the order is changed? Similar to afterSelect and afterDeselect it would be great to have an afterSort. |
|
@alani1: Currently the sortable option does not fire a custom event. I use jQueryUI for the sortable option though, which fires a range of events: http://api.jqueryui.com/sortable/ |
|
Any news on this getting merged into master? @lou ? |
|
@Mactory I'm having some issues when loading the data... Basically the order is not kept when loading the data to it. Any suggestions on how to resolve this? Thanks! |
|
@chrisbartolo For me, the order of elements are kept. Can you send me a code snippet? I might be able to help you then. |
|
Hello, I'm new to GitHub... But, I wanted to know if the issue regarding the sortable option returning the sorted order as an array? Any info would be appreciated. Regards, |
|
For the multi-select the values are POSTed as an array. The array is ordered in the order that is selected in the widget. |
|
Right, I understand that. I guess what I'm getting at is, is there a way to reset or create a new array based on the values after sorting? Thanks for replying. Please forgive confusion on my behalf. |
|
No worries. I am still unsure what you need though. Do you want one array in the original order and one in the new, sorted order? |
|
My apologies, the new sorted order is what I mean. Regards, |
|
that is exactly what you should get with the sortable option enabled. Under the hood, the plugin re-orders the |
|
@Mactory Any suggestions if you need to reload the page with the same sorting in place? I know I could switch the output order of the options, but then the original side would be out of order as options get put disabled. |
|
This is what I ended up with.. Could probably use some cleanup. |
This was helpful. Thankyou. |
Adding the ability to sort the selected elements (As requested in #171 ). This requires jQueryUI to be loaded. If it is not loaded, the sortable option is automatically deactivated and a corresponding warning is issued.