It sort of makes sense that this is a recursion issue, as I keep hitting the
'You need to know the future' (i.e the next row before it's happened)
feeling..

Re: Michael, yes, assume the query is sorted (i.e the depth is how deep the
containing UL is).

It does my head in. Recursion that is.

On 26 August 2010 16:35, Ian Skinner <h...@ilsweb.com> wrote:

>
>  I *THINK* what you are trying to do is a classic problem for a
> recursive function.
>
> Create a function that handles one level of your list with the proper
> <ul> and <li> tags.
>
> Then for each record inside the logic for the <li>... test to see if
> there is another level, if so call the same function.
>
> Rough and incomplete pseudo code.
>
> <cffunction name="myMenu"...>
>   ....
> <ul>
> <cfloop....>
> <li>
>         #anMenuItem#
> <cfif anotherLevel>myMenu()</cfif>
> <li>
> </cfloop>
> </ul>
>
>
> <cfreturn theMenu>
> </cffunction>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336581
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to