jQuery Interface Sortable Module

Events happening in the community are now at Drupal community events on www.drupal.org.
marcp's picture

Just a quick pointer to the jQuery Interface Sortable module that we added last week. In 5.x, it depends on the excellent jQuery Update and jQuery Interface modules. In 6.x (or HEAD -- I'm still trying to figure out how I got that 6.x release node in there), it only requires jQuery Interface.

This module is a requirement in 5.x and beyond for Nodeorder, which used to depend on SPAjax. Nodeorder (for which I can't seem to be able to get a release node for 6.x or HEAD) was also working in HEAD as of a few days ago -- if anyone feels like trying it out and filling up the issue queue, we'd be grateful.

jQuery Interface Sortable exposes a form element called 'sortable' -- which does pretty much what the one in SPAjax used to do. I'd love to see someone turn this into a CCK widget ... if it hasn't been done already.

Marc


http://www.funnymonkey.com
Tools for Teachers

Comments

I think we need a jquery

ray007's picture

I think we need a jquery plugin manager.
Or do we really want one drupal module per jquery plugin?

--
best regards

    Ray

If you need a drupal developer contact me!

--
best regards

    Ray

If you need a drupal developer contact me!

Plugin?

jjeff's picture

Well I don't know if you've looked at the code for the Interface Sortable Module, but it's not really a JQuery plugin. It builds upon a JQuery plugin (Interface) to create a Drupal form element that presents as a drag-and-droppable list. (Can you say, "Bye bye, weight field?")

I understand what you're saying about having a whole lot of tiny little modules that only bring in tiny little bits of JS code, but the Interface library is relatively large, so it's important that there is a module to act as a central arbiter to make sure two modules don't include the same code. I could see an argument for making this an even more abstracted module managing many JQuery plugins, but just the process of keeping all of the plugin code up to date is going to be a big job. I'm more inclined to keep it simple.

-= Jeff Robbins | Lullabot | Drupalize.me =-

Excellent!

jjeff's picture

it depends on the excellent jQuery Update and jQuery Interface modules

Hey! He said, "excellent"!!!

I'm really glad that people are starting to use these modules. The more modules that use them, the more stable I will feel that they are.

Marc, did you find any problems with them? Do you feel like they're ready for a 1.0 release?

-= Jeff Robbins | Lullabot | Drupalize.me =-

Ready for 1.0

marcp's picture

They are definitely excellent enough to be 1.0 releases.

Things worked flawlessly for me. When I did the jQuery Update, I tested things out by replacing jquery.js in misc before enabling the module to see what would happen. I saw the expected "fieldsets expand but don't collapse" problem, and then enabled jQuery Update and all was good. So I think it's a nice little feel-good exercise for the user to go about it in that order.

It's a bummer that the version of jQuery in Drupal 5 core is so out-of-date that it doesn't work with Interface's Sortable. I went around and around trying to figure out the best, and easiest to maintain, way to get drag-and-drop working in 5.x, and was pretty close to checking out YUI when I found jQuery Update & jQuery Interface. Jjeff -- you saved the day!

Marc

RE the sortable form element

bonobo's picture

As jjeff says, "Bye bye, weight field" --

We've been using this to organize and maintain learning standards -- the sortable field allows users to organize fields within a node by dragging and dropping them -- we implemented this on a site and it has been working flawlessly for the last 6 months --

Extending this functionality to a cck field opens up all kinds of possibilities -- a drag and drop orderable to-do list, and who knows what kind of havoc could be wrought by extending drag and drop sorting to nodereference, viewfield, or link cck fields --

Any cck wizards in the house ? ;)

The sortable field, in conjunction with nodeorder, allows for flexible re-organization of content, and of fields within individual pieces of content.

// note to self -- time to start testing the Outline module
// drag and drop ordering of nodes within a stripped down book would also be nice.

Cheers,

Bill