AJUDA COM TREEVIEW

JPTNETO 06/08/2013 16:02:40
#427089
Boa tarde galera,
Vi um treeview com CSS aqui e editei pra fazer um dinamico em asp.
Funcionou mas ficou MUITO lento. Pensei em talvez fazer com array, ou sei lá.
Alguém pode ajudar? Dar uma dica?

<div class=[Ô]css-treeview[Ô]>
<ul>
<li>
<%strSQL = [Ô]Select codProc, nomProc from processos where codProc=[Ô]&numProc&[Ô];[Ô]
set Rs = cnnDB.Execute(strSQL)%>
<input type=[Ô]checkbox[Ô] checked id=[Ô]<%=Rs([Ô]codProc[Ô]) %>[Ô] /><label for=[Ô]<%=Rs([Ô]codProc[Ô]) %>[Ô]><%=Rs([Ô]nomProc[Ô]) %></label>
<%set Rs = nothing %>
<ul>

<% strSQL = [Ô]select nomElemento, numElemento from elementos where numProcesso=[Ô]&numProc&[Ô] and tipoElemento=[ô]Raias[ô];[Ô]
set RsRaia = server.CreateObject([Ô]ADODB.RecordSet[Ô])
RsRaia.Open strSQL, cnnDb
if not RsRaia.EOF then
do until RsRaia.EOF%>
<li>
<input type=[Ô]checkbox[Ô] checked id=[Ô]<%=RsRaia([Ô]numElemento[Ô])%>[Ô] /><label for=[Ô]<%=RsRaia([Ô]numElemento[Ô])%>[Ô]><%=RsRaia([Ô]NomElemento[Ô]) %></label>
<ul>
<% strSQL = [Ô]select nomElemento, numElemento from elementos where numProcesso=[Ô]&numProc&[Ô] and tipoElemento=[ô]Tarefa[ô] and elementoPai = [ô][Ô]&RsRaia([Ô]numElemento[Ô])&[Ô][ô];[Ô]
set Rs = server.CreateObject([Ô]ADODB.RecordSet[Ô])
Rs.Open strSQL, cnnDB
if not Rs.EOF then
do until Rs.EOF
%>
<li>
<input type=[Ô]checkbox[Ô] checked id=[Ô]<%=RS([Ô]numElemento[Ô])%>[Ô] /><label for=[Ô]<%=RS([Ô]numElemento[Ô]) %>[Ô]><%=Rs([Ô]NomElemento[Ô]) %></label>
<ul>
<% strSQL = [Ô]Select nomElemento, numElemento from elementos where numProcesso=[Ô]&numProc&[Ô] and tipoElemento=[ô]Executante[ô] and elementoPai=[ô][Ô]&Rs([Ô]numElemento[Ô])&[Ô][ô];[Ô]
set RsExec = server.CreateObject([Ô]ADODB.RecordSet[Ô])
RsExec.Open strSQL, cnnDB
if not RsExec.EOF then
do until RsExec.EOF%>
<li>
<input type=[Ô]checkbox[Ô] checked id=[Ô]<%=RsExec([Ô]numElemento[Ô]) %>[Ô] /><label for=[Ô]<%=RsExec([Ô]numElemento[Ô])%>[Ô]><%=RsExec([Ô]NomElemento[Ô]) %></label>
<% RsExec.MoveNext
loop
end if
set RsExec = nothing %>
</li>
</ul>
</li>
<% Rs.MoveNext
loop
end if
set Rs = nothing %>
</ul>
<% RsRaia.MoveNext
loop
end if
set RsRaia = nothing
%>
</li>
</ul>
</li>
</ul>
</div>
KERPLUNK 06/08/2013 16:10:36
#427091
O problema é a estrutura de suas tabelas. Pelo modo como elas estão, você tem que fazer muitas consultas...
Faça seu login para responder