This is essential coldfusion recursive custom tag returning all child branches for current one for an hierarchical table. By Hierarchical Table, I mean here a way of organization of data inside of sql table where rows have parent ones in the same table, within one-to-many relationship (this data model is also known as parent-child relationship):
CATEGORY
CATEGORYID
PARENTID
Web
15
0
Web Development and Design
16
15
Coldfusion
17
16
PHP
18
16
ASP.net
19
16
This is a nice way to store data but it may be a problem when you need to retrieve hierarchical tree from stored rows. This is the goal of the Get Child Branches custom tag.
Accepting Parameters:
table - table name (for the example above, "Category")
idfield - name of the ID field (here, "Categoryid")
namefield - name of the char name value field ("Category")
subidfield - name of the field which points to the parent branch ("Parentid")
branchid - starting branch id to draw tree from (default = "" - top)
So to get tree from the example table it would run like this:
what returns 3 lists with the same length delimited by "|"
idbabylist - list of IDs (for the example: "15|16|19|17|18")
namebabylist - list of names ("web|web development and design|ASP.net|coldfusion|PHP")
levelbabylist - nesting levels list ("0|1|2|2|2)
So that is easy do draw tree accordingly entries sort order and nested depth:
Web
Web Development and Design
ASP.net
Coldfusion
PHP
BRIEF DESCRIPTION: Coldfusion recursive custom tag returning all child branches for current one for an hierarchical table (parent-child relationship). Parent-child relationship within the same table
Add your review to this item:
Existing customers please login (click "Your Account" top menu item). New customers choose
Quick Registration including just your name, email and password or
Complete Registration