Solved

RECURSIVE FUNCTION FOR AN ASP FORUM

Posted on 2002-07-15
3
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Javascript to allow login/password authorization 4 63
Cannot open file from ASP if user is "logged in" 13 40
Sending ASP to server side 8 44
Diff of the day 2 43
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 informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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