Results 1 to 3 of 3

Thread: Parent/Child problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156

    Question

    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.


    The MORE I get to know,
    I realize that I know NOTHING !

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156
    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

    The MORE I get to know,
    I realize that I know NOTHING !

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2000
    Posts
    156
    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.

    The MORE I get to know,
    I realize that I know NOTHING !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width