What about using Prototype / Script.Aculo.Us?

(or on all the other JS/DHTML libs)





"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Brian Swartzfager
To: CF-Talk
Sent: Thu Mar 22 18:08:26 2007
Subject: Re: OT JS - Moving elements in page

>Anyone have any pointers or examples of DHTML ordering? Will it be a case
of
>deleting and reinserting elements where needed?

I messed around with doing something similar a lot lately, and I came up
with two different approaches:

If the elements you want to "move" only contain one or two simple elements
(like text or hyperlinks), you can simply swap the text or values of those
child elements instead of actually moving the position of the elements in
the DOM hierarchy.  I actually just made a UI tool that does just that in
the Downloads box on the right-hand side of my blog (there's a working
example on that download page as well):

http://www.swartzfager.org/blog

.....the purpose of the tool is really to _record_ the rearrangement of the
elements (usually the elements of a list or table), not just visually
rearrange them, but the JS techniques are the same.  It works in all the
major browsers (including Safari).

The other approach is more like what you did with your reorder.html:  I had
to build a bookmark portlet for our portal system, and I wanted users to not
only be able to nest bookmarks and folders, but to be able to reorder two
folders at the same level in the hierarchy...which meant moving all of the
bookmarks and folders contained in the folder.  I ended up writing some
functions that would clone the elements, remove the original elements, and
then place the clones in the proper position of the document by figuring out
which page element the clone should appear before and then using the
insertBefore method.

It works in Netscape, IE, FireFox, and Opera, but not in Safari:  one of the
functions involves reassigning element ids and Safari doesn't seem to like
that for whatever reason.

If you're interested in seeing the code for the second approach, I could
probably clean it up for public consumption.

--
Brian Swartzfager
[EMAIL PROTECTED]
http://www.swartzfager.org/blog



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273407
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to