its all about the parentId, as long as you know that, and your main
heading, non-indents
have a parent of 0, then order them by recordId or some other ordering
schema, it works.
you cfquery for parents, then under those parents, you cfquery for
children that match
the parentID
make sense?
tony
Check out these John
http://affy.blogspot.com/ntm/index.htm
WG
-Original Message-
From: John Sprenkle [mailto:[EMAIL PROTECTED]
Sent: 09 July 2003 14:19
To: CF-Talk
Subject: Creating a list with infinite groupings and indents
Say I have a table with the following records:
rec id
First off... the way you have it setup now will only allow for two levels..
level 1 and level 2. To get the ability you are after (tree type strucutre),
you need to get into nested sets. Joe Celko has done some awesome work in
this area and the links below may help you out. It is a bit tricky at
BTW Joe Clecko had an entire book on trees coming soon
TREES HIERARCHIES IN SQL (Morgan-Kaufmann), 2003
http://www.celko.com/books.htm
WG
-Original Message-
From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
Sent: 09 July 2003 14:48
To: CF-Talk
Subject: Re: Creating a list with
Im not sure I agree.
with a simple categories tableyou can nest as many as you want with
this?
id
categoryName
parentId
cfquery name = getParents
select * from categories where parent = 0 order by name
/cfquery
UL
cfloop query = getParents
cfoutput
cfif getParents.recordCount
---im a
http://www.houseoffusion.com/_library/
This is the (almost) latest version of my CF_MakeTree and is what's used to
thread the messages on the HoF mail archives. Infinite across the board and
exactly what you need.
Say I have a table with the following records:
rec id description
I think this is pretty much the same thing that others have pointed you
towards, but I think this article might be easier to read:
http://www.sitepoint.com/article/1105
Sarah
At 7/9/2003 11:10 AM, you wrote:
BTW Joe Clecko had an entire book on trees coming soon
TREES HIERARCHIES IN SQL
This brings up an interesting question for me. I tend to use recursive
functions frequently, and have even had to solve a problem very similar to
the original question posed in this thread. My take on the solution is the
following (in php):
itemIDitemparentID
First and foremost, we can't run queries inside of cfscript tags.
Bummer.
easy enough with a wrapper function.
Second, even if the query issue were resolved (and if you've got ideas for
work-arounds, I'd love to hear them), you've now got variable scope
issues.
A variable declared in a CFMX
On Wednesday, Jul 9, 2003, at 13:13 US/Pacific, Hagan, Ryan Mr
(Contractor ACI) wrote:
function list_categories( $parentId, $level ) {
cffunction name=list_categories
cfargument name=parentId type=numeric
cfargument name=level type=numeric
global $database, $connection;
Worth mentioning that you can use custom tags in a recursive manner. I have
several recursive tree generators on various versions of CF that use custom
tags, UDFs and CFC methods. custom tags and CFFUCTION-based UDFs (including
CFCs) can have CFQUERY tags in them, although if you're making a
Hagan, Ryan Mr (Contractor ACI) wrote:
I personally like this solution quite a bit. I know it has performance
issues, but I've never noticed any significant impact on server response,
even under heavy load.
I think it is an ugly workaround. SQL is a set oriented language and the
best way
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=7321lngWId=4
Much faster in just about every regard (except updating) than the
below method, and sorting is built in.
Jon Hall wrote:
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=7321lngWId=4
Thats actually a fairly old idea. Always seemed to me that inserting records or
Wednesday, July 9, 2003, 5:13:02 PM, you wrote:
MR Jon Hall wrote:
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=7321lngWId=4
MR Thats actually a fairly old idea.
I speak not for this guy...except to say he sounds pretty
typical of the average VB dork's I run into.
I'll bet. I wasn't lumping you in with His Majesty's royal attitude. :D
Did you look at Michael Dinowitz' cf_maketree? He mentioned it earlier on in this
thread. I use it and its pretty
Wednesday, July 9, 2003, 5:50:33 PM, you wrote:
I speak not for this guy...except to say he sounds pretty
typical of the average VB dork's I run into.
MR I'll bet. I wasn't lumping you in with His Majesty's royal attitude. :D
MR Did you look at Michael Dinowitz' cf_maketree? He mentioned it
MR Did you look at Michael Dinowitz' cf_maketree? He mentioned it earlier on
in this thread. I use it and its pretty cool. Its quite fast, and not that
much slower than cfx_fMakeTree (which is
MR blazing fast).
I seriously doubt any method written in CF could come close to this
method as
18 matches
Mail list logo