树行问题?
各位大侠。为什么我这个没有子层数据。只有第一层数据
<script>
function expand(id){
window.status=eval("s"+id).innerText;
getLight(id);
if(eval("s"+id).href!='')document.frames['nodehref'].location.href=eval("s"+id).href
switch(eval("dir"+id).innerText){//改变"+","-"
case "-":
eval("dir"+id).innerText="+";eval("dir"+id).className='dirclose';document.getElementById("load_"+id).style.display='none';break;
case "+":
eval("dir"+id).innerText="-";eval("dir"+id).className='diropen';document.getElementById("load_"+id).style.display='';break;
default:eval("dir"+id).innerText=".";eval("dir"+id).className='dirNode';
}
if(eval("dir"+id).innerText==".")return;
if(eval("dir"+id).innerText=="+"){if(document.getElementById("t"+id)){eval("t"+id).removeNode(true);return;}}
document.frames['hifm'].location.href="subtree.asp?id="+id
}
function getLight(id){//高亮度显示当前结点
var s=document.getElementsByTagName("SPAN")
var sn=document.getElementById("s"+id)
for(i=0;i<s.length;i++)if(s[i].className=='node')s[i].style.cssText="color:#000000;background-color:#f2f2f2"
sn.style.cssText="color:#000000;background-color:#ffffff;border:1 solid #999999"
}
</script>
<body topmargin="0" leftmargin="0" scroll="no">
<% dim conn,rs
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.mappath("Collection.mdb") & ";Persist Security Info=False"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select *,(select count(*) from indexTable where Parent = theID) as children from indexTable where theID=Parent",conn,1,3
%>
<div align="center">
<center>
<table border="0" width="779" cellspacing="0" cellpadding="0" height=100% bgcolor="#F2F2F2">
<tr>
<td width="260" style="border-right:5 solid #6699cc" valign="top" align="left">
<div id=treedir style="overflow:auto;width:100%;height:100%">
<table border='0' cellspacing='0' cellpadding='0' style='position:relative;left:18;top:20' onselectstart="return false">
<%
do while not rs.eof
if rs("children")<=1 then
s="."
cls="dirNode"
else
s="+"
cls="dirclose"
end if
%>
<tr><td id='node<%=rs("theID")%>' class='td_node' valign=top><span class='<%=cls%>' id='dir<%=rs("theID")%>' onclick='expand(<%=rs("theID")%>)'><%=s%></span><span class='node' id='s<%=rs("theID")%>' onclick='expand(<%=rs("theID")%>)' title='<%=rs("theName")%>' href='<%=rs("theName")%>'><%=rs("theName")%></span></td></tr>
<% if rs("children")>1 then%>
<tr id="load_<%=rs("theID")%>" style="display:none"><td class='td_node'><table border='0' cellspacing='0' cellpadding='0' style='position:relative;left:18;top:0'><tr><td class='td_node'><span class='dirNode'>.</span><span class='load'>Loading...</span></td></tr></table></td></tr>
<%end if%>
<% rs.movenext
loop
%>
</table>
</div>
</td>
<td valign="top" align="left">
<iframe name=nodehref style="border:1 solid #3366cc;width:100%;height:100%;overflow:auto" src="about:blank" frameborder=0 ></iframe>
</td>
</tr>
</table>
</center>
</div>
<%
set rs=nothing
set conn=nothing
%>
<iframe id='hifm' width=0 height=0></iframe>
</body>