|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
grouping output
Author: Pascal Peters
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32363#162511
Actually, he is using oracle and LEVEL is a system column when using
CONNECT BY. It doesn't have to exist in the table.
----- Excess quoted text cut - see Original Post for more -----
Author: Nando
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32363#162508
If you have a level field in your table, that is. Very handy to include.
You could also define a style based on the level, dynamically set the class in a
div
tag for instance, and then do whatever is necessary in your style sheet for each
level.
<div class="menu#LEVEL#"> ... </div>
Use "level" to determine the output
SELECT *, LEVEL
FROM NAVMENU
START WITH MNUPARENT = 0
CONNECT BY PRIOR MNUPARENT=MNUCHILD
<cfoutput query="qMenu"...>
#RepeatString("- ",qMenu.level)# #qMenu.MNUDISP#<br>
</cfoutput>
This is simple, but you can do more complicated things by using level
----- Excess quoted text cut - see Original Post for more -----
Author: Pascal Peters
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32363#162507
Use "level" to determine the output
SELECT *, LEVEL
FROM NAVMENU
START WITH MNUPARENT = 0
CONNECT BY PRIOR MNUPARENT=MNUCHILD
<cfoutput query="qMenu"...>
#RepeatString("- ",qMenu.level)# #qMenu.MNUDISP#<br>
</cfoutput>
This is simple, but you can do more complicated things by using level
----- Excess quoted text cut - see Original Post for more -----
Author: Greg.Morphis
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32363#162490
I'm wanting to dynamically create a menu.
My table has 6 columns.
MNUITEMNUM (primary key - increments on insert),
MNUPARENT (the parent menu id),
MNUCHILD (the child menu id),
MNUURL (the link associated with the menu item),
MNUDISP (what's displayed as the menu item),
MNUWIN (determines whether to open in new or same window)
So here's a sample menu...
MNUITEMNUM MNUPARENT MNUCHILD MNUURL MNUDISP MNUWIN
21 1 0 javascript:; Equipment
22 21 1 Assets/Documents/handset_matrix.xls Handset Profiles new
23 22 1 index.cfm?template=htm Handset Training Materials same
24 103 1 javascript:; Rebates
25 21 103 Assets/Documents/T720 Rebate spiff 4-1-04.c2.doc Current Rebates
new
26 22 103 Assets/Documents/T720 rebate procedures.doc Rebate Procedures
new
27 23 103 mailto:xxxx@abc.com Rebate Support
28 25 1 Assets/Documents/roam_indicators.doc Roam Indicators new
This creates a menu that looks like
Equipment > Handset Profiles
Handset Training Materials
Rebates > Current Rebates
Rebate Procedures
Rebate Support
Roam Indicators
now I can get this to output with SQL..
SELECT *
FROM NAVMENU
START WITH MNUPARENT = 0
CONNECT BY PRIOR MNUPARENT=MNUCHILD
But I want to output this using Cold Fusion to show a visual of the menu..
I've tried using group and output but I'm coming up with nothing..
Maybe see something like I demonstrated above...
IE
Equipment
-Handset Profiles
-Handset Training Materials
-Rebates
--Current Rebates
--Rebate Procedures
--Rebate Support
-Roam Indicators
How can this be done?
******************************************************************************************
The information contained in this message, including attachments, may contain
privileged or confidential information that is intended to be delivered only to
the
person identified above. If you are not the intended recipient, or the person
responsible for delivering this message to the intended recipient, ALLTEL
requests
that you immediately notify the sender and asks that you do not read the message
or its
attachments, and that you delete them without copying or sending them to anyone
else.
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||