h1

Drag and Drop ordering

June 29, 2007

Here is a very useful link that walks you through how to create a simple drag and drop section for a website. It creates a list and lets you move items around the list so that you can order them as you wish. With a little bit of CSS, this could turn into a really nice simple organiser.

http://dustinweber.com/cakephp/cakephp-sortable-ajax-drag-drops-the-basics/

I did find that I had to edit my javascript includes a little bit though. I had the scriptaculous libraries loaded with this tagged on at the end
?load=effects
With this in place, I was getting errors that sortable wasn’t defined. Once I removed it, it all worked perfectly.

3 comments

  1. If you remove ?load=effects, scriptaculous loads all of the libraries. I believe that you can specify them like this ?load=effects,drag,drop. This will save your viewers from having to download unnecissary js files.


  2. That’s a handy hint alright. I thought that was what was happening, but then I didn’t follow up on this. Thanks for pointing it out.

    Mike.


  3. I am using Google hosted javascripts and use

    google.load(”scriptaculous”,”1.8.1″);

    to load Scriptaculous. Is there a way to limit loading only drag and drop libraries and not load the entire scriptaculous library?



Leave a Comment