This is something I have wanted and needed for a long time. Ordering dragging works great when the widget is set to auto-complete, but is kind of annoying to have to "remember" the names of all the nodes and which one you want to add. It would be awesome if we could get a simple drop-down select widget that is draggable! I know there is the jquery draggable widget but I do not like the look and it is a huge pain to install.



I was going to suggest this myself eventually. I've built this into a few modules like Block reference because some people don't want the autocomplete but still want to reorder the values.

I think it may work if I dynamically replace the textfield with a drop-down with jquery, and make sure the values sync up. But I just need a way to get a list of all the available nodes. Then the top select option could have a "none" option with a value of "" (same as highlighting an autocomplete node and deleting the contents.

I know this is hackish but I am desperate for this feature!

new1.14 KB
new17.63 KB

Well, I got it to work with some jquery! A cool side effect of this is we can hide the [nid] since that info is stored in the select value attribute anyway.

The only issue I am having is I cant seem to target the click event for the "add more items" submit button. I need to call my magic function when that gets clicked otherwise the fields revert back to autocomplete textfields. Any ideas?

Also note that the attached js is more of a proof of concept and is nowhere near polished enough to be solid

new1.14 KB

Found out that the "add more items" event is chained to the mouseDown event. But there was still the problem of waiting for the ahah response to comeback. So I just attached the function to using jQuery's awesome $(document).ajaxStop. Works like a charm!

Just include this file into the footer of your admin theme.

It currently will automatically apply the swap to any autocomplete nodereference field, but I am working on putting this into a module so you can select which items to apply it to, or maybe make it it's own widget.

new3.17 KB

One more update:

Fixed a loop with the ajaxstop function and allowed the ability for multiple multi-drags to be on one page

FYI: I have made a drupal 6.x module for this

I'd love to use this. Could you post steps on what to do with the JS file?

I'm trying to use node_reference as a field in the module I'm building so ideally I'd like to tag it into that if possible.

Changing that order will affect the deltas stored the database? Could this work for ordering a list of checkboxes?

I know this is late but figured i would post if it helps anyone. An easy way to accomplish this is to use the fieldgroup module

Simply create a new fieldgroup, and add a single select-widget node reference. Then make the fieldgroup set to unlimited. Voila! Draggable select boxes :) Hope this helps someone.

I did not see a way to make #9 work, at least in D7. "Then make the fieldgroup set to unlimited" - there doesn't seem to be any such option.

Maybe #9 meant the field_collection module?

I can confirm this is possible with Field collection

Status:Active» Postponed