![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
09/09/2005, 11:25
|
![Avatar de onlykfk](http://static.forosdelweb.com/customavatars/avatar113307_1.gif) | | | Fecha de Ingreso: agosto-2005 Ubicación: 20°45' Latitud Norte 100°
Mensajes: 121
Antigüedad: 19 años, 5 meses Puntos: 1 | |
Cita:
Iniciado por andinistas Ok tienes algún ejemplo que demuestre lo que dices? yo no sé como proceder vía javascript. <html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script language=javascript>
function redibujaTabla(datos){
var arrCols, nRow = document.all.mytabla.rows.length;
datos = datos.substring(0,datos.length-2); //Para kitarle el ultimo pipe
arrRengDatos = datos.split("|");
if(arrRengDatos.length<=0) { return; }
//Insertas el nuevo renglon
document.all.mytabla.insertRow(nRow);
//Lees el ultimo registro agregado
arrCols = arrRengDatos[arrRengDatos.length-1].split(";");
//Agregas las columnas
for(i = 0; i < 2; i++){
document.all.mytabla.rows[document.all.mytabla.rows.length-1].insertCell(i);
}
//Llenas con los datos del ultimo registro
for(i = 0; i < 2; i++){
document.all.mytabla.rows[document.all.mytabla.rows.length-1].cells[i].innerText = arrCols[i];
}
}
function agregaRenglon(tmp){
tmp.value += "|nuevo;valor"; //En tu caso sera el retorno que te da el WindowModal
//Solo ke para simplificarte el ejemplo
redibujaTabla(tmp.value);
}
</script>
</head> <body>
<table id="mytabla" border="1">
<thead><tr><td>Campo 1</td><td>Campo 2</td></tr></thead>
<tbody>
<tr>
<td>Hello</td>
<td>World</td>
</tr>
</tbody>
</table>
</body>
<textarea name="txtdatos" style="display:none"></textarea>
<input type="button" onclick="agregaRenglon(txtdatos);" value="Agregar valor">
</html>
Saludos
__________________ Yo tan sólo se, que no he senado |