There are loads and loads of DHTML menus out there, e.g.
http://www.dynamicdrive.com/dynamicindex1/hvmenu/

with the actual menu code taken care of, all you have to do is recurse over
your database and write out the menu items.

last time i checked, cftree outputs a java applet, not javascript.

do you not know how to recurse?

heres some pseudo code

variables.inst.menuqry = getAllCategories();

function buildmenu(currentid){
        var i=0;
        for(i=1; i lte variables.inst.menuqry.recorcount; i=i+1){
        if(variables.inst.menuqry.parent_id[i] eq arguments.currentID)
                writeoutput(your javascript);
                buildmenu(variables.inst.menuqry.id[i]);
        }
        }
}

buildmenu(yourrootid);


-----Original Message-----
From: Stephen Whiteley [mailto:[EMAIL PROTECTED]
Sent: 26 October 2005 11:15
To: CF-Talk
Subject: Recursion anyone?


Hi

I keep returning to this problem in order to build an infinite DHTML menu (a
task which has now become a quest and a matter of honour). Does anyone know
how to recurse through an adjacency list model table, of the following setup

ID CategoryName ParentItemID

Also, I hear you can use CFTREE format="xml" or format="object" and then use
that to make a DHTML menu? anyone have any experience

Muchos Thank You's

Steve



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222284
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to