var numLinesAdded2 = 0;
function AddRow(TableId,cells)
{
var tbl = document.getElementById(TableId);
var x = tbl.insertRow(tbl.rows.length);
var tdCells = cells.split(';');
var cell;
cell = x.insertCell(0);
cell.innerHTML = " img style='CURSOR: hand' src='images/delete.gif' alt='Delete' onclick='javascript:DeleteRow("+TableId+", this)'>";
for(i=0; i < tdCells.length; i++)
{
cell = x.insertCell(1);
cell.innerHTML = tdCells[i];
}
}
function DeleteRow(TableId,row)
{
var i=row.parentNode.parentNode.rowIndex
TableId.deleteRow(i)
}
No comments:
Post a Comment