随手写的一个动态添加删除行的HTC行为组件[2]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 mybios 的 blog

  cell[i].innerhtml=eval("element.td_innerhtml"+i);
  cell[i].style.csstext=eval("element.td_csstext"+i);
  restoreevent("element.rows["+ln+"].cells["+i+"]","td"+i);
 }
 initcolor();
 t=element
 t.rows[ln].attachevent("onclick",lighton);
 t.rows[ln].style.cursor="default";
 t.rows[ln].cells[0].style.backgroundcolor=element.delcolor;
 t.rows[ln].cells[0].style.cursor="hand";
 t.rows[ln].cells[0].attachevent("onclick",delit);
 t.rows[ln].cells[0].attachevent("onmouseover",delmouseover);
 t.rows[ln].cells[0].attachevent("onmouseout",delmouseout);
}
function copyevent(tfrom,tto,str1,str2,xxx)
{
 eval(tto+"."+str2+"onactivate="+tfrom+"."+str1+"onactivate");
 eval(tto+"."+str2+"onbeforeupdate="+tfrom+"."+str1+"onbeforeupdate");
 eval(tto+"."+str2+"onblur="+tfrom+"."+str1+"onblur");
 eval(tto+"."+str2+"oncellchange="+tfrom+"."+str1+"oncellchange");
 eval(tto+"."+str2+"onchange="+tfrom+"."+str1+"onchange");
 eval(tto+"."+str2+"onclick="+tfrom+"."+str1+"onclick");
 eval(tto+"."+str2+"oncontextmenu="+tfrom+"."+str1+"oncontextmenu");
 eval(tto+"."+str2+"oncontrolselect="+tfrom+"."+str1+"oncontrolselect");
 eval(tto+"."+str2+"oncopy="+tfrom+"."+str1+"oncopy");
 eval(tto+"."+str2+"oncut="+tfrom+"."+str1+"oncut");
 eval(tto+"."+str2+"ondblclick="+tfrom+"."+str1+"ondblclick");
 eval(tto+"."+str2+"ondeactivate="+tfrom+"."+str1+"ondeactivate");
 eval(tto+"."+str2+"ondrag="+tfrom+"."+str1+"ondrag");
 eval(tto+"."+str2+"ondragend="+tfrom+"."+str1+"ondragend");
 eval(tto+"."+str2+"ondragenter="+tfrom+"."+str1+"ondragenter");
 eval(tto+"."+str2+"ondragleave="+tfrom+"."+str1+"ondragleave");
 eval(tto+"."+str2+"ondragover="+tfrom+"."+str1+"ondragover");
 eval(tto+"."+str2+"ondragstart="+tfrom+"."+str1+"ondragstart");
 eval(tto+"."+str2+"ondrop="+tfrom+"."+str1+"ondrop");
 eval(tto+"."+str2+"onerrorupdate="+tfrom+"."+str1+"onerrorupdate");
 eval(tto+"."+str2+"onfilterchange="+tfrom+"."+str1+"onfilterchange");
 eval(tto+"."+str2+"onfocus="+tfrom+"."+str1+"onfocus");
 eval(tto+"."+str2+"onhelp="+tfrom+"."+str1+"onhelp");
 eval(tto+"."+str2+"onkeydown="+tfrom+"."+str1+"onkeydown");
 eval(tto+"."+str2+"onkeypress="+tfrom+"."+str1+"onkeypress");
 eval(tto+"."+str2+"onkeyup="+tfrom+"."+str1+"onkeyup");
 eval(tto+"."+str2+"onmousedown="+tfrom+"."+str1+"onmousedown");
 eval(tto+"."+str2+"onmouseenter="+tfrom+"."+str1+"onmouseenter");
 eval(tto+"."+str2+"onmouseleave="+tfrom+"."+str1+"onmouseleave");
 eval(tto+"."+str2+"onmousemove="+tfrom+"."+str1+"onmousemove");
 eval(tto+"."+str2+"onmouseout="+tfrom+"."+str1+"onmouseout");
 eval(tto+"."+str2+"onmouseup="+tfrom+"."+str1+"onmouseup");
 eval(tto+"."+str2+"onmouseover="+tfrom+"."+str1+"onmouseover");
 eval(tto+"."+str2+"onmove="+tfrom+"."+str1+"onmove");
 eval(tto+"."+str2+"onmoveend="+tfrom+"."+str1+"onmoveend");
 eval(tto+"."+str2+"onmovestart="+tfrom+"."+str1+"onmovestart");
 eval(tto+"."+str2+"onpage="+tfrom+"."+str1+"onpage");
 eval(tto+"."+str2+"onpaste="+tfrom+"."+str1+"onpaste");
 eval(tto+"."+str2+"onresize="+tfrom+"."+str1+"onresize");
 eval(tto+"."+str2+"onresizeend="+tfrom+"."+str1+"onresizeend");
 eval(tto+"."+str2+"onresizestart="+tfrom+"."+str1+"onresizestart");
 eval(tto+"."+str2+"onrowenter="+tfrom+"."+str1+"onrowenter");
 eval(tto+"."+str2+"onrowexit="+tfrom+"."+str1+"onrowexit");
 eval(tto+"."+str2+"onrowsdelete="+tfrom+"."+str1+"onrowsdelete");
 eval(tto+"."+str2+"onrowsinserted="+tfrom+"."+str1+"onrowsinserted");
 eval(tto+"."+str2+"onscroll="+tfrom+"."+str1+"onscroll");
 eval(tto+"."+str2+"onselect="+tfrom+"."+str1+"onselect");
 eval(tto+"."+str2+"onselectstart="+tfrom+"."+str1+"onselectstart");
}
function restoreevent(tto,str)
{
 copyevent("element",tto,str,"",1);
}
function backupevent(tfrom,str)
{
 copyevent(tfrom,"element","",str);
}
</script>

 

 

 

 

 

 

 

 

 

<!--***********************dtable.htm******************************-->
<link href="cb2.css" type=text/css rel=stylesheet>
<style type="text/css">
 .t{behavior:url(dtable.htc)}
</style>
<!-- start defining the menu -->

<table class="t" id=tableid cellpadding=0 cellspacing=0 border=0>
<tr>
 <td>x</td>
 <td>表格表哥</td> <td>表格表哥</td> <td>表格表哥</td> <td>表格表哥</td>
</tr>

本文关键:HTC,动态表,行为
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top