Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/12/2010, 17:18
slimnot4
 
Fecha de Ingreso: noviembre-2010
Mensajes: 24
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: tree view con checkbox

aqui va la segunda parte disculpen por ponerlo asi pero el foro tiene restricion de caracteres.


else
{
head1 = obj.parentElement.previousSibling;
}
var chk2 = false;
if(head1!=null)
{
if(head1.tagName == "TABLE")
{
head2 = obj.parentElement.parentElement.previousSibling;
if(head2!=null)
{
if(head2.tagName == "TABLE")
{
tbls = head1.parentElement.getElementsByTagName("TABLE");
var pTreeLevel2 = head1.rows[0].cells.length;
tblsCount = tbls.length;
for (i=0; i < tblsCount; i++)
{
childTreeLevel = tbls[i].rows[0].cells.length;
if (childTreeLevel == pTreeLevel2)
{
chld = tbls[i].getElementsByTagName("INPUT");
if(chld.length>0)
{
if (chld[0].checked == true)
{
chk2 = true;
break;
}
}
}
}
nd = head2.getElementsByTagName("INPUT");
if(nd.length>0)
{
nd[0].checked = (chk2 && chk1);
}
}
}
}
}
else
{
head2 = obj.parentElement.previousSibling;
}
var chk3 = false;
if(head2!=null)
{
if(head2.tagName == "TABLE")
{
head3 = obj.parentElement.parentElement.parentElement.prev iousSibling;
if(head3!=null)
{
if(head3.tagName == "TABLE")
{
tbls = head2.parentElement.getElementsByTagName("TABLE");
var pTreeLevel3 = head2.rows[0].cells.length;
tblsCount = tbls.length;
for (i=0; i < tblsCount; i++)
{
childTreeLevel = tbls[i].rows[0].cells.length;
if (childTreeLevel == pTreeLevel3)
{
chld = tbls[i].getElementsByTagName("INPUT");
if(chld.length>0)
{
if (chld[0].checked == true)
{
chk3 = true;
break;
}
}
}
}
nd = head3.getElementsByTagName("INPUT");
if(nd.length>0)
{
nd[0].checked = (chk3 && chk2 && chk1);
}
}
}
}
}
else
{
head3 = obj.parentElement.previousSibling;
}
var chk4 = false;
if(head3!=null)
{
if(head3.tagName == "TABLE")
{
head4 = obj.parentElement.parentElement.parentElement.pare ntElement.previousSibling;
if(head4!=null)
{
if(head4.tagName == "TABLE")
{
tbls = head3.parentElement.getElementsByTagName("TABLE");
var pTreeLevel4 = head3.rows[0].cells.length;
tblsCount = tbls.length;
for (i=0; i < tblsCount; i++)
{
childTreeLevel = tbls[i].rows[0].cells.length;
if (childTreeLevel == pTreeLevel4)
{
chld = tbls[i].getElementsByTagName("INPUT");
if(chld.length>0)
{
if (chld[0].checked == true)
{
chk4 = true;
break;
}
}
}
}
nd = head4.getElementsByTagName("INPUT");
if(nd.length>0)
{
nd[0].checked = (chk4 && chk3 && chk2 && chk1);
}
}
}
}
}
} }
var numTables = tables.length
if (numTables >= 1)
{
for (i=0; i < numTables; i++)
{
if (tables[i] == obj)
{
treeNodeFound = true;
i++;
if (i == numTables)
{
return;
}
}
if (treeNodeFound == true)
{
childTreeLevel = tables[i].rows[0].cells.length;
if (childTreeLevel > parentTreeLevel)
{
var cell = tables[i].rows[0].cells[childTreeLevel - 1];
var inputs = cell.getElementsByTagName("INPUT");
inputs[0].checked = checkedState;
}
else
{
return;
}
}
}
}
}
}