|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
grouping output
I'm wanting to dynamically create a menu.Greg.Morphis 05/06/04 06:46 P Use "level" to determine the outputPascal Peters 05/07/04 03:16 A If you have a level field in your table, that is. Very handy to include.Nando 05/07/04 04:38 A Actually, he is using oracle and LEVEL is a system column when usingPascal Peters 05/07/04 06:54 A 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. 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 ----- 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 ----- 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 -----
|
February 09, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||