>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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273405
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