Solved

RECURSIVE FUNCTION FOR AN ASP FORUM

Posted on 2002-07-15
3
235 Views
Last Modified: 2006-11-17
I have a Tree view forum.
I need to create a recursive javascript function in order to 'close messages' (I use the display property - block/none) and their children.

Each item of the tree is in a <TR> named "rec" with a unique ID which is structed like ID="TopParentID,Level,MessageID,ParentID".

 -TopParentID=Top most message of the thread
 -Level=Level of the current messege within the thread
 -MessageID=Message ID
 -ParentID=Parent ID of the current message.

here is what I did: (and doesn't work)
--------------------
***the GetTree function is being called upon closing an item in the thread

function GetTree(ParID)
{

allTRs=document.all.tags("tr")
TRLength=allTRs.length
     
for (i=0;i<TRLength;i++)
     {
      if (allTRs.item(i).name=="rec" )
          {
                   
               var Arrsplit=allTRs.item(i).id.split(",");
               var SunID=Arrsplit[0]
               var LevelThread=Arrsplit[1]
               var MesID=Arrsplit[2]
               var ParentID=Arrsplit[3]
               if (ParentID==ParID)
                    {
                    eval("document.all('"+SunID+","+LevelThread+","+MesID+","+ParentID+"').style.display='none'")
                    GetTree(MesID)          
                    }
         
               
          }
         
     }          
               
               
}
0
Comment
Question by:meme_25
3 Comments
 
LVL 3

Expert Comment

by:mastallama
Comment Utility
You can use <DIV> tags and JavaScript to make it work.  Just have the JavaScript show and hide the <DIV> tags, the only possible problem with this would be when the page initially loads.  If there are thousands of threads on one page, it would load them all before allowing the user to navigate the page.

~ MastaLlama ~
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
This question appears to have been abandoned. Please come back to this question and do the necessary evaluation or feedback. I will invite a Moderator to close this question if there's no reply from you after seven days.

I suggest
<delete>

** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **

hongjun
0
 

Accepted Solution

by:
modulo earned 0 total points
Comment Utility
PAQ'd and points removed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now