Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

RECURSIVE FUNCTION FOR AN ASP FORUM

Posted on 2002-07-15
3
Medium Priority
?
249 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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