In your current situation you can only have one node in a specific level
expanded. Try looking at a way to store the expanded entries of childs
of a parent, instead of storing them in a list form. 

What you have now, is 

a,b,c,d,e 

But what you should look into is

a = a,b
b = c,d

etc.


You should be able to do this with some basic recursion.

Micha Schopman
Project Manager

Modern Media, Databankweg 12 M, 3821 AL  Amersfoort
Tel 033-4535377, Fax 033-4535388
KvK Amersfoort 39081679, Rabo 39.48.05.380

------------------------------------------------------------------------
------------------------------------------------------------------------
-----
Modern Media, Making You Interact Smarter. Onze oplossingen verbeteren
de interactie met uw doelgroep. 
Wilt u meer omzet, lagere kosten of een beter service niveau? Voor meer
informatie zie www.modernmedia.nl 
------------------------------------------------------------------------
------------------------------------------------------------------------
-----
-----Original Message-----
From: simmyana a [mailto:[EMAIL PROTECTED] 
Sent: dinsdag 16 augustus 2005 9:47
To: CF-Talk
Subject: Re: Dynamic Tree view in ColdFusion

This is what i did, but i am unable to track the expanded subcategories

any help?



<cfparam name="categoryids" default="">

<InvalidTag language="javascript">
        /*function node(id)
        {
                
                window.location="testbgTreeview.cfm?id=" + id;

        } */
        
        function submitform(id)
        {
          document.myform.action="testbgTreeview.cfm?id=" + id;
          document.myform.method="post";
          document.myform.submit();
        }



</script>
<cfquery name="GetLevelOne" datasource="#dbname#">
        Select * from bgcategory where categorylevel=0  order by
categoryname
</cfquery>


 
  
  <cfset categoryids="">
  
  <cfif IsDefined('url.id')>
        <cfif form.categoryids eq ''>
                <cfset categoryids=#url.id#>
        <cfelse>
                <cfset categoryids=form.categoryids & "," & #url.id#>
        </cfif>
        
        
  </cfif>
 
  
 <cfoutput>#categoryids#</cfoutput>
 <form name="myform" action="testbgTreeview.cfm" method="post">
<cfoutput query="GetLevelOne">
  <table border="0">
        <tr>
                <td onClick="javascript:submitform(#categoryid#)"><img
src="images/section_expand.gif">#categoryname#</td>
        </tr>
  </table>
        
</cfoutput>
        
        <cfif isdefined('url.id')>
        
                <cfloop list="categoryids" index="j">
                
                        <cfquery name="GetLevelOne"
datasource="#dbname#">
                                Select * from bgcategory where
supercategoryid=#url.id# and categoryid<>#url.id#  order by categoryid
                        </cfquery>
                                                
                        <cfoutput query="GetLevelOne">
                          <table border="0">
                                <tr>
                                <cfif GetLevelOne.categorylevel gt 0>
                                        <cfloop from="1"
to="#GetLevelOne.categorylevel#" index="i">
                                                <td>&nbsp;</td>
                                        </cfloop>
                                </cfif>
                                        <td
onClick="javascript:submitform(#GetLevelOne.categoryid#)"><img
src="images/section_expand.gif">#categoryname#</td>
                                </tr>
                          </table>
                                
                        </cfoutput>
                
                </cfloop>
        </cfif>
        
        
<cfoutput>
<input type="hidden" name="categoryids" value="#categoryids#">
</cfoutput>
</form>


>Simmyana, 
>
>What have you tried already to get things working, or do you have
>examples on which we can comment on. Did you look at code examples,
>documentation or something like that?
>
>Micha Schopman
>Project Manager
>
>Modern Media, Databankweg 12 M, 3821 AL  Amersfoort
>Tel 033-4535377, Fax 033-4535388
>KvK Amersfoort 39081679, Rabo 39.48.05.380



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:215131
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