I looked at this method and all the others, and decided to go with
the non-traditional method outlined here.
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7321&lngWId=4

Much faster in just about every regard (except updating) than the
below method, and sorting is built in.
Matt Liota also detailed a similar, faster variant of this on the
cfczone list recently.

-- 
 jon
 mailto:[EMAIL PROTECTED]

Wednesday, July 9, 2003, 9:19:04 AM, you wrote:
JS> Say I have a table with the following records:

JS> rec id      description          parent id
JS> 1             Test Record 1      0
JS> 2             Test Record 2      1
JS> 3             Test Record 3      1
JS> 4             Test Record 4      3
JS> 5             Test Record 5      3
JS> 6             Test Record 6      4
JS> 7             Test Record 7      4
JS> 8             Test Record 8      3

JS> The parent id field relates a record to its parent. I want to display the
JS> records in a list so that children records are listed indented under their
JS> parent. There can be an infinite number of nested parents and children, so there
JS> could be many indents in the list. The output in this example should look like
JS> this:

JS> Test Record 1
JS>       Test Record 2
JS>       Test Record 3
JS>             Test Record 4
JS>                  Test Record 6
JS>                  Test Record 7
JS>             Test Record 5
JS>             Test Record 8

JS> Could somebody give me direction on how to program this? Sample code?

JS> Thank you.




JS> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to