JS动态生成的table行,怎么获取要删除的当前行
--------------------编程问答-------------------- 各位大神?都在哪呢? --------------------编程问答--------------------
function LoadProduct(payment){
var o=document.all("tabProj");
var objAddRow=o.insertRow(o.rows.length);
objAddRow.height="24px";
objAddRow.style.fontsize="9pt"
objAddRow.oid=payment[1];
objAddRow.MainID=payment[0];
objAddRow.onclick=function (){var URL="../../fceform/common/djframe.htm?djsn=jzxt_hyxx_d885b23e-72fc-466b-9c53-7f881a675a00&djtype=TT&DjName=会议信息&GUID="+objAddRow.oid;
openMyWin(URL);};
objAddRow.RIndex=(o.rows.length-1);
//序号
objAddCell = objAddRow.insertCell(0);
objAddCell.align = "center";
objAddCell.insertAdjacentHTML("BeforeEnd", o.rows.length - 1);
//类型
objAddCell = objAddRow.insertCell(1);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[2] + '</nobr>');
//会议层级
objAddCell = objAddRow.insertCell(2);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[3] + '</nobr>');
//主题
objAddCell = objAddRow.insertCell(3);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[4] + '</nobr>');
//主持人
objAddCell = objAddRow.insertCell(4);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[5] + '</nobr>');
//参会人
objAddCell = objAddRow.insertCell(5);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[6] + '</nobr>');
//会议时间
objAddCell = objAddRow.insertCell(6);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[7] + '</nobr>');
//时长
objAddCell = objAddRow.insertCell(7);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[8] + '</nobr>');
//材料准备
objAddCell = objAddRow.insertCell(8);
objAddCell.align = "left";
objAddCell.className = "gridBorder";
objAddCell.insertAdjacentHTML("BeforeEnd", '<nobr>' + payment[9] + '</nobr>');
}
--以上是动态生成的行,怎么获取我想要删除的当前行
加个ID来删除! --------------------编程问答-------------------- http://ligerui.com/分 --------------------编程问答-------------------- //通过当前行后面的delete链接删除本行
function removeRow(obj){
var t=document.getElementById('table1');
t.deleteRow(obj.parentNode.parentNode.rowIndex)
}
//给table删除指定的行,可以一行,也可以多行
function delTableRow(){
var table1 = document.getElementById('table1');
var isChecked = document.getElementsByName('isChecked');
var len = isChecked.length;
for(var i=len-1;i>=0;i--){
if(isChecked[i].checked==true){
table1.firstChild.removeChild(isChecked[i].parentNode.parentNode);
//alert(isChecked[i].id);
//alert(isChecked[i].parentNode.parentNode.innerHTML);
}
}
补充:.NET技术 , ASP.NET