Newsgroup: it.comp.lang.javascript
Titolo: Treewiev completo

Chi sa dove posso reperire uno script completo che mi visualizzi un
treewiev? Ne ho trovati alcuni che però fanno riferimento a script su js.
Se lo avete me lo postate qui di seguito? magari anche con la parte html che
mi permette di capire come funziona!!!
100000 grazie!!!

Spartanissimo:
            document.writeln('<style type="text/css">');
            document.writeln('td.tvw {FONT-SIZE: 8pt; FONT-FAMILY: Verdana,
Arial, Helvetica; PADDING: 0px; CURSOR: hand;}');
            document.writeln('img.tvw {PADDING: 2px; MARGIN-RIGHT: 3px;
CURSOR: hand;}');
            document.writeln('</style>');
            var tvwChildSuffix="_Children";
            var tvwContentsSuffix="_Contents";
            var tvwPlusMinusSuffix="_PlusMinus";
            var tvwPlusText="<img class=tvw src='plus.bmp'>";
            var tvwMinusText="<img class=tvw src='minus.bmp'>";
            var tvwDotText="<img class=tvw src='dot.bmp'>";
            var tvwApice1='"';
            var tvwApice2="'";
            function tvwAddElement(parent, id, txt)
            {
                if(parent=="")
                {
                    document.writeln("<table cellpadding=0 cellspacing=0>");
                    document.writeln("<tr><td class=tvw onclick='javascript:
tvwShowHideElement(" + tvwApice1 + id + tvwApice1 + ");'><SPAN ID='" + id +
tvwPlusMinusSuffix + "'>" + tvwDotText + "</SPAN>" + txt + "</td></tr><tr
id='" + id + tvwChildSuffix + "' style='display: none;'><td class=tvw id='"
+ id + tvwContentsSuffix + "'></td></tr></table>");
                }
                else
                {
                    var Obj=document.getElementById(parent +
tvwContentsSuffix);
                    var PM=document.getElementById(parent +
tvwPlusMinusSuffix);
                    PM.innerHTML=tvwPlusText;
                    if(Obj.innerHTML=="")
                    {
                        Obj.innerHTML="<table cellpadding=0
cellspacing=0><tr><td class=tvw style='padding-left: 10px'
onclick='javascript: tvwShowHideElement(" + tvwApice1 + id + tvwApice1 +
");'><SPAN ID='" + id + tvwPlusMinusSuffix + "'>" + tvwDotText + "</SPAN>" +
txt + "</td></tr><tr id='" + id + tvwChildSuffix + "' style='display:
none;'><td class=tvw style='padding-left: 10px' id='" + id +
tvwContentsSuffix + "'></td></tr>";
                    }
                    else
                    {
                        Obj.innerHTML=Obj.innerHTML.substring(0,
Obj.innerHTML.length-8) + "<tr><td class=tvw style='padding-left: 10px'
onclick='javascript: tvwShowHideElement(" + tvwApice1 + id + tvwApice1 +
");'><SPAN ID='" + id + tvwPlusMinusSuffix + "'>" + tvwDotText + "</SPAN>" +
txt + "</td></tr><tr id='" + id + tvwChildSuffix + "' style='display:
none;'><td class=tvw style='padding-left: 10px' id='" + id +
tvwContentsSuffix + "'></td></tr></table>";
                    }
                }
            }
            function tvwShowHideElement(ElementName)
            {
                var Obj=document.getElementById(ElementName +
tvwChildSuffix);
                var Cont=document.getElementById(ElementName +
tvwContentsSuffix);
                var PM=document.getElementById(ElementName +
tvwPlusMinusSuffix);
                if(Obj.style.display=="none")
                {
                    if(Cont.innerHTML!="")
                    {
                        PM.innerHTML=tvwMinusText;
                        Obj.style.display="inline";
                    }
                }
                else
                {
                    if(Cont.innerHTML!="")
                    {
                        PM.innerHTML=tvwPlusText;
                        Obj.style.display="none";
                    }
                }
            }
/*
<HTML>
 <HEAD>
  <TITLE>TreeView</TITLE>
 </HEAD>
 <BODY>
        <SCRIPT SRC="TreeView.js" LANGUAGE="JavaScript">
        </SCRIPT>
  <SCRIPT language="javascript">
            tvwAddElement("", "myroot", "myroot");
            tvwAddElement("myroot", "child_1", "child_1");
            tvwAddElement("myroot", "child_2", "child_2");
            tvwAddElement("myroot", "child_3", "child_3");
            tvwAddElement("myroot", "child_4", "child_4");
            tvwAddElement("child_2", "child_5", "child_5");
            tvwAddElement("child_2", "child_6", "child_6");
            tvwAddElement("child_5", "child_7", "child_7");
            tvwAddElement("child_4", "child_8", "child_8");
            tvwAddElement("child_8", "child_9", "child_9");
        </SCRIPT>
 </BODY>
</HTML>
*/
Altrimenti guarda su 
www.webfx.eae.net
--
Lieutenant
Look at 
www.jargoncode.it
"Francy" <l...@oooo.pp> wrote in message
news:z4Ava.111820$DT4.3...@twister1.libero.it...
