PDA

Click to See Complete Forum and Search --> : Parent/Child problem


lirlir
Jul 19th, 2000, 01:33 AM
hi there ,

i wrote a code that draw a few tables ,
the first one is display but the next(below the first one)
r hidden.

all the tables have IMG in one of their fields.

i wand to be able to display the first table children by
clicking the table IMG.

after the second table has appear i want to show the
next 2 child tables.

YES, THIS IS A TREEVIEW !!!

my question is how to use Parent/Child relationship between
the tables.

lirlir
Jul 19th, 2000, 01:49 AM
I forgot to attach the code so :


<HEAD>
<STYLE>
TABLE {font-size:10 ; font-face:TimeNew ; column-height:20 ; row-height:20;}
IMG {width:14 ; height:18 }
BODY{{Background-color:"#ffffd0"}
</STYLE>
<BASE TARGET="main">
<SCRIPT language="JavaScript">
<!-- //Creates folding tree effect
var head="display:''"
function doit(header)
{
var head=header.style
if (head.display=="none")
head.display=""
else
head.display="none"
} //-->
</SCRIPT>
</HEAD>
<HTML>
<body>
<TABLE ID=parentTable cellpadding=0 cellspacing=0 onclick='doit(this)'>
<TR><TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_open.gif'></TD>
<TD><A HREF='ix_jsa.asp'>Root</A></TD></TR>
</TABLE>
<TABLE ID=childTable NAME='tbla' cellpadding=0 cellspacing=0>
<TR><TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_listp.gif' ></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_book.gif'></TD>
<TD><A HREF='details.asp?key=a'>A</A></TD></TR>
</TABLE>
<TABLE ID=childTable NAME='tblaa' style='display:none' cellpadding=0 cellspacing=0>
<TR><TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_listp.gif' ></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_book.gif'></TD>
<TD><A HREF='details.asp?key=aa'>AA</A></TD></TR>
</TABLE>
<TABLE ID=childTable NAME='tblaaa' style='display:none' cellpadding=0 cellspacing=0>
<TR><TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_end.gif' ></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_leaf.gif'></TD>
<TD><A HREF='details.asp?key=aaa'>AAA</A></TD></TR>
</TABLE>
<TABLE ID=childTable NAME='tblaab' style='display:none' cellpadding=0 cellspacing=0>
<TR><TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_list.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_leaf.gif'></TD>
<TD><A HREF='details.asp?key=aab'>AAB</A></TD></TR>
</TABLE>
<TABLE ID=childTable NAME='tblab' style='display:none' cellpadding=0 cellspacing=0><TR>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_listp.gif' ></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_book.gif'></TD>
<TD><A HREF='details.asp?key=ab'>AB</A></TD></TR>
</TABLE>
<TABLE ID=childTable NAME='tblb' cellpadding=0 cellspacing=0><TR>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_line.gif'></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_listp.gif' ></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_book.gif'></TD>
<TD><A HREF='details.asp?key=b'>B</A></TD></TR>
</TABLE>
<TABLE ID=childTable NAME='tblc' cellpadding=0 cellspacing=0><TR>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_end.gif' ></TD>
<TD><IMG WIDTH=14 HEIGHT=18 SRC='images/ix_leaf.gif'></TD>
<TD><A HREF='help.htm'>My Helper</A></TD></TR>
</TABLE>

</BODY>
</HTML>


the tree look like that :
-R
+A <-----when clicking on the plus icon i want
to show AA,AB nodes only.
+B
-Helper


-R
-A
-AA
-AAA
-AAB
-AB
-B


pleas help

lirlir
Jul 19th, 2000, 02:11 AM
you can see how the code works in here

http://www10.ewebcity.com/lirlir/treeview/ix_jsa.htm

the problem is in the parent/child relations and in the
function doit.

thanks again for your future help.