http://www.stedy.com/iewidgets/coolultragrid/coolUltraGrid.htm
解决方案 »
- js如何写单击button按钮后datalist里的label的visible属性变为true
- action中文乱码
- 我要匹配 "javascript" 以外的 所有字符的正则应该怎么写
- 跪求高人指点一下 JWChat 接收消息的原理.
- 急,送分,一个完全不做网页的小白碰到的一个送分参数传递问题,在线等~
- 文字作移的教本怎么不起作用哪?
- 如何在send form 的时候, 把整个form 发到制定的email 去?
- 我有一个表单,为了防止用户不选择就递交,我在submit的onclick里写了校验代码,但在校验单选框时遇到问题,if form.vFrom.value="" then
- 请问如何用JavaScript编写.js帮win2k系统添加一个用户?
- 用alert函数在日文系统下不能正确显示中文,怎么办?
- Windows Opened by Script Lose Authentication or Session
- 如何在网页打开时,用户名输入框就得到焦点?
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
var curRow=null;
function selectRow(){
var e=window.event;
var tr1=e.srcElement;
if(curRow)
curRow.bgColor="#FFFFFF";
tr1.bgColor="e7e7e7";
curRow=tr1;
}
function addRow(src){
//alert(src);
var newrow = src.insertRow(src.rows.length);
newrow.attachEvent("onclick",selectRow);
newrow.height=20;
var i=4;
while(i--){
var newcell = newrow.insertCell();
newcell.align="center";
newcell.innerHTML=div1.innerHTML;
}
//alert(newrow.outerHTML);
}
function txtKeyPress(){
var e=window.event;
if(e.keyCode!=13) return;
else{
if(e.srcElement.parentElement.cellIndex==3)
addRow(e.srcElement.parentElement.parentElement.parentElement);
e.keyCode=9;
}
}
</script>
</head><body>
<table id="tb" width="100%" border="1" align="center" cellpadding="1" cellspacing="1" style="border-collapse:collapse" bordercolor="#111111">
<tr>
<th scope="col" width="25%">一</th>
<th scope="col" width="25%">二</th>
<th scope="col" width="25%">三</th>
<th scope="col" width="25%">四</th>
</tr>
<tr id="blankRow">
<td align="center"><input type="text" style="width:80%" onKeyDown="txtKeyPress()"></td>
<td align="center"><input type="text" style="width:80%" onKeyDown="txtKeyPress()"></td>
<td align="center"><input type="text" style="width:80%" onKeyDown="txtKeyPress()"></td>
<td align="center"><input type="text" style="width:80%" onKeyDown="txtKeyPress()"></td>
</tr>
</table>
<div id="div1" style="display:none "><input type="text" style="width:80%" onKeyDown="txtKeyPress()"></div>
</body>
</html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
var curRow=null;
function selectRow(tr1){
if(curRow)
curRow.bgColor="#FFFFFF";
tr1.bgColor="e7e7e7";
curRow=tr1;
}
function addRow(src){
var newrow = src.insertRow(src.rows.length-1);
newrow.attachEvent("onclick",function(){selectRow(newrow);});
newrow.height=20;
var i=4;
while(i--){
var newcell = newrow.insertCell();
switch(i){
case 0: newcell.innerHTML= '<input type="button" onClick="javascript:delRow(this.parentElement.parentElement)" value="删除此行">';break;
default: newcell.innerHTML=div1.innerHTML;break;
}
}
}
function delRow(src){
src.parentElement.deleteRow(src.rowIndex);
}
</script>
</head><body>
<table id="tb" width="100%" border="1" align="center" cellpadding="1" cellspacing="1" style="border-collapse:collapse" bordercolor="#111111">
<tr>
<th scope="col" width="25%">一</th>
<th scope="col" width="25%">二</th>
<th scope="col" width="25%">三</th>
<th scope="col" width="25%">四</th>
</tr>
<tr id="blankRow" onClick="addRow(this.parentElement)">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<div id="div1" style="display:none "><input id="txt" type="text" style="width:97%; background-color:#FFFFEF"></div>
</body>
</html>
src.parentElement.deleteRow(src.rowIndex);
}我想问一下上面的src.rowIndex是什么时候设置的呀,没看见呀