>- see footer for list info -<
My attachment didn't work, so here's the code.
<!---
|| Satachi Application Framework by Russ Michaels
|| Page Name : MOD_Tree.cfm
|| Application : framework
|| Version : 1.0
|| Last Edited by : Russ Michaels
|| Last Edited On : 10/10/02
|| Absract : A module to create a nested
tree of parent/child items from a query
|| Type of template : MODULE
|| Calling template : any
|| Incomming Params : query = the query to use
nodeText = the
column to use for the text on each node
IDcolumn = the
primary ID column to use
onclick = call
javascript function when link is clicked
|| Params Set :
|| Outgoing Params :
--->
<cfparam name="attributes.query">
<cfparam name="attributes.nested" default="false">
<cfparam name="attributes.nodeText">
<cfparam name="attributes.IDcolumn">
<cfparam name="attributes.onclick" default="false">
<cfparam name="attributes.ttileClass" default="">
<cfif NOT attributes.nested>
<!--- create a list of all the parentID's so that we can check
whether a node has children before nesting the module --->
<table width="100%" cellspacing="2" cellpadding="0" border="0">
<cfoutput><th
class="#attributes.titleClass#">#attributes.title#</th></cfoutput>
</table>
<cfset request.query=evaluate('caller.'&attributes.query)>
<cfset request.parentlist = valuelist(request.query.parentID)>
</cfif>
<cfoutput>
<table border="0">
<cfloop query="request.query">
<cfif attributes.onclick>
<cfset onclick = "F_editContainer(#containerID#)">
<cfelse>
<cfset onclick = '#attributes.editlink#&containerID=#containerID#'>
</cfif>
<cfif attributes.nested>
<!--- display nested nodes --->
<cfif attributes.parentID IS parentID>
<tr><td valign="top" background="images/tree_bar.gif"><img
src="images/icons/folder_open.gif" alt="" width="18" height="18"
border="0"></td><td><a <cfif attributes.onclick>onclick="#onclick#"</cfif>
href="#IIF(not attributes.onclick, "link",DE("javascript:
void"))#">#evaluate(attributes.nodeText)#</a><cfif
Listfind(request.parentlist,evaluate(attributes.IDcolumn))><cfmodule
template="MOD_tree.cfm" query="#request.query#" nested="true"
nodeText="#attributes.nodeText#" parentID="#evaluate(attributes.IDcolumn)#"
IDcolumn="#attributes.IDcolumn#" editlink="#attributes.editlink#"
onclick="#attributes.onclick#"></cfif></td></tr>
</cfif>
<cfelse>
<cfif parentID is 0>
<!--- display regular nodes --->
<tr><td valign="top" background="images/tree_bar.gif"><img
src="images/icons/folder_open.gif" alt="" width="18" height="18"
border="0"></td><td><a <cfif attributes.onclick>onclick="#onclick#"</cfif>
href="#IIF(not attributes.onclick, "link",DE("javascript:
void"))#">#evaluate(attributes.nodeText)#</a><cfif
Listfind(request.parentlist,evaluate(attributes.IDcolumn))><cfmodule
template="MOD_tree.cfm" query="#request.query#" nested="true"
nodeText="#attributes.nodeText#" parentID="#evaluate(attributes.IDcolumn)#"
IDcolumn="#attributes.IDcolumn#" editlink="#attributes.editlink#"
onclick="#attributes.onclick#"></cfif></td></tr>
</cfif>
</cfif>
</cfloop>
</cfoutput>
</table>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Russ
> Michaels (Snake)
> Sent: 10 January 2005 09:55
> To: [EMAIL PROTECTED]; 'Coldfusion Development'
> Subject: RE: [CF-Dev] Unlimited Hierarchy (recursive)
>
> >- see footer for list info -<
>
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<