House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

grouping output

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Greg.Morphis
05/06/2004 06:46 PM

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.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/07/2004 03:16 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Nando
05/07/2004 04:38 AM

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 -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/07/2004 06:54 AM

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 -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 09, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29