Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RECURSIVE FUNCTION FOR AN ASP FORUM

Posted on 2002-07-15
3
Medium Priority
?
252 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
ID: 7154816
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
ID: 7510482
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
ID: 7551610
PAQ'd and points removed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

972 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