It doesn't do everything you want, but the core of it can be accomplished
easily using my ObCollectionOrdered _javascript_ abstraction here (long URL
alert!):

http://www.depressedpress.com/depressedpress/Content/Development/_javascript_/
Extensions/ObCollectionOrdered/Index.cfm

The collection object allows you to store object while maintaining order and
provides full rank and sorting functions to move elements around, promote
them, demote them, sort them, swap positions, etc.

There a sample on the site than shows you how to do this in a Select list.

I've used it to do something similar to what you're asking about - I
populate a div by looping over the collection and displaying it's elements
(how you do that is up to you).  Then the interface determines how to order
them - for example if you drag onto an element you can easily insert that
object into the collection.  Then all you have to do is rerun the display
function.

In essence all you're doing is making changes the abstraction object based
on interface events and then redisplaying it.  Don't bother trying to modify
the display to represent your object manipulations: just redisplay the whole
thing from scratch.  _javascript_ is so fast it makes no difference and it's
much, much simpler.

Jim Davis

From: Guy McDowell [mailto:[EMAIL PROTECTED]
Sent: Friday, September 03, 2004 10:13 AM
To: CF-Talk
Subject: DHTML Drag and Drop to reorder record set

Hi,

I'm not a DHTML guy by any means. Could someone point me in the right
direction to figuring out how to use DHTML to take a record from within a
record set, drag it to a higher or lower position, and have it change its
position within the record set?

Basically what I have is like a to do list. But lets say I want to take item
#5 and drop it between item #2 and #3 so it becomes the new #3 and the old
#3 becomes #4 and so on.....

I've got the logic basically but not the code. Any good tutorials or
examples of something similar?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to