Similar feature request to one from the Block Reference module: #659584: Select widget fix for re-ordering blocks
I need to be able to sort the selected values from a select list (in my case it was for a Node Reference). With the "multiple values" select list, you have to hold ctrl or shift to select multiple values, and you CANNOT re-order them.
So I borrowed some code from the autocomplete widget to create a drag and drop sortable widget for select lists. It doesn't replace the Select list widget, it simply adds an additional widget to the drop-down.
Is there already a module which provides this? I searched and didn't find one. Regardless, it seems like a good idea to add this to CCK or Core in D7.
Comment | File | Size | Author |
---|---|---|---|
#6 | 789542-select-list-drag-n-drop-sorting-cck3-6.patch | 5.22 KB | rupl |
#1 | select-list-drag-n-drop-sorting-cck3.patch | 3.95 KB | pifantastic |
select-list-drag-n-drop-sorting.patch | 4 KB | puddyglum | |
select-list-drag-n-drop-sorting.png | 6.65 KB | puddyglum |
Comments
Comment #1
pifantastic CreditAttribution: pifantastic commentedTested this patch with cck3 and it works well! One of the patch chunks fails so I updated the patch for cck3.
Thanks @jmonkfish this is exactly what we were looking for.
Comment #2
jeff.k CreditAttribution: jeff.k commentedThis is awesome. I have been looking for something like this for a while.
It would be great to have this in the core cck for all select lists options.
Comment #3
brian_c CreditAttribution: brian_c commentedThanks for the patch, very useful.
There seems to be an issue with HTML entities though. Specifically, it is replacing ampersands with
&
when it shouldn't be, like in the middle of an entity reference.For instance, it is transforming
'
(which should render as an apostrophe) into'
(which renders as'
).So "
Bob's Foobar
" renders as "Bob's Foobar
".I solved this by changing theme_nodereference_select_sortable() to:
Seems like a workaround though, ideally would be better to track down where the original replacement is occurring and prevent it.
Comment #4
pifantastic CreditAttribution: pifantastic commentedJust out of curiosity, has anyone used this patch on a CCK field inside a multigroup? At first glance it does not appear to work. I haven't had a chance to dive into the code and look for a fix.
Comment #5
firebus CreditAttribution: firebus commentedsubscribing! it's unfortunate that multiple node references don't allow ordering the way that most multiple fields do.
are the maintainers interested in providing this feature? i assume we'd need a patch for 7 and 6.x-3.x before it can be committed to 6.x-2.x?
Comment #6
ruplRe-rolling the patch from pifantastic in #1 against current 6.x-3.x-dev
One small change, because the auto-complete results contained some HTML. I added an optional flag to
nodereference_allowed_values()
to allow output of 'title' instead of hardcoded 'rendered' option, which is now default.Comment #7
ruplForgot to update version!
Comment #8
ramotowski CreditAttribution: ramotowski commentedAfter click "Add another item" all values in select lists appears empty.
Comment #9
bingorabbit CreditAttribution: bingorabbit commentedAny idea about a Drupal 7 Port?!