代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
JS
】
结合checkbox动态产生tr可分页完整版
作者:
using
/ 发布于
2012/10/22
/
825
<div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></div> <div><html xmlns="http://www.w3.org/1999/xhtml"></div> <div><head></div> <div><meta http-equiv="Content-Type" content="text/html; charset=GBK" /></div> <div><meta name="Author" content="author by using 20121016 QQ:471116029"></div> <div><title>差旅人选择</title></div> <div></div> <div><script language="JavaScript"></div> <div></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>/* 已有差旅人JS, begin */</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>function changgeTriverRes(checks) {</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>var tempArr = checks.split("-");</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span>certRow(tempArr[0],tempArr[1],tempArr[2],tempArr[3],tempArr[4]);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>} <div> /* 创建新的一行 */</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>function certRow(args1,args2,args3,args4,args5)</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>{</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>document.getElementById("triveralDiv").style.display = "block";</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span>var txtTRLastIndex = document.getElementById("certTRLastIndex");</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span>var rowID = parseInt(txtTRLastIndex.value);</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span>var MyTable = document.getElementById("certTable");</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span>var newTr = MyTable.insertRow(MyTable.rows.length);</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span>newTr.id = "certItem" + args1;</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span>//添加5列</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> var newTd0 = newTr.insertCell(0);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> var newTd1 = newTr.insertCell(1);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> var newTd2 = newTr.insertCell(2);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> var newTd3 = newTr.insertCell(3);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> var newTd4 = newTr.insertCell(4);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> var newTd5 = newTr.insertCell(5);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> </div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> newTd0.innerHTML = ' ';</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> newTd1.innerHTML = '<div title="' + args2 + '" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:120px;cursor: pointer;">' + args2 + '</div>' + '<input type="hidden" id="checkedItem" name="checkedItem" value="' + args1 + '" />';</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> newTd2.innerHTML = '<div>' + args3 + '</div>';</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> newTd3.innerHTML = '<div>' + args4 + '</div>';</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> newTd4.innerHTML = '<div>' + args5 + '</div>';</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> newTd5.innerHTML = '<div><input type="hidden" id="tableRows" name="tableRows" value="certItem'+ rowID +'" /><input type="hidden" id="tableRows_'+args1+'" value="certItem'+ rowID +'" /><input type="button" value="删除" onclick="deliveryDeleteSignRow(\'certItem' + rowID + '\','+args1+'\);"/></div>';</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> txtTRLastIndex.value = (rowID + 1).toString();</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span></div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>} <div><span class="Apple-tab-span" style="white-space:pre"> </span>function deliveryDeleteSignRow(rowid,userid){</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>var MyTable = document.getElementById("certTable");</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>var signItem = document.getElementById("certItem"+userid);</div> <div></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>var txtTRLastIndex = document.getElementById("certTRLastIndex");</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>var rowIDZ = parseInt(txtTRLastIndex.value);</div> <div></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>//获取将要删除的行的Index</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>var rowIndex = signItem.rowIndex;</div> <div></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>//删除指定Index的行</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>if (typeof(rowIndex) =="undefined") {</div> <div> <span class="Apple-tab-span" style="white-space:pre"> </span>rowIndex = rowIDZ+1;</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>} <div><span class="Apple-tab-span" style="white-space:pre"> </span>MyTable.deleteRow(rowIndex);</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>txtTRLastIndex.value = (rowIDZ - 1).toString() ;</div> <div></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>/* 隐藏已有的差旅人列表DIV */</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>if(txtTRLastIndex.value == "0") {</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>document.getElementById("triveralDiv").style.display = "none";</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>} <div><span class="Apple-tab-span" style="white-space:pre"> </span>/* 取消子页面上对应的差旅人checkbox的勾 */</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>if(window.frames['iframeResult'].document.getElementById("checkedItem_"+userid) != null) {</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>window.frames['iframeResult'].document.getElementById("checkedItem_"+userid).checked = false;</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>window.frames['iframeResult'].checkFalse(); //去除顶部checkbox</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span>} <div><span class="Apple-tab-span" style="white-space:pre"> </span>} <div><span class="Apple-tab-span" style="white-space:pre"> </span>/* 已有差旅人JS, end */</div> <div><span class="Apple-tab-span" style="white-space:pre"> </span></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span></div> <div></script></div> <div></head></div> <div><body></div> <div><form action="" id="frm" method="post" name="frm"></div> <div><div style="display: none" id="triveralDiv"></div> <div> <table id="certTable" style="width:780px"></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <tr height="10px;"></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <td><input name='certTRLastIndex' type='hidden' id='certTRLastIndex' value="0" /></td></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> </tr></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <tr></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span><td> </td></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <td><font color="#065991">中文姓名</font></td></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <td><font color="#065991">英文姓名</font></td></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <td><font color="#065991">手机号码</font></td></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <td><font color="#065991">Email邮箱</font></td></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> <td><font color="#065991">删除</font></td></div> <div><span class="Apple-tab-span" style="white-space:pre"> </span> </tr></div> <div> </table></div> <div></div></div> <div></div> <div><br/></div> <div><br/></div> <div><br/></div> <div></div> <div><!-- 差旅人查询结果 --可以调用数据库动态产生,使用iframe是为了,结果翻页的时候不把上面已经存在的差旅人列表给清空掉,也可以不是用iframe考虑ajax获取数据 --></div> <div><iframe src="childPage.html" id="iframeResult" name="iframeResult" height="150" width="100%" scrolling="no" marginwidth="0" frameborder="0" style=""></iframe></div> <div></div> <div></form></div> <div></body></div> <div></html></div> <div></div>
试试其它关键字
checkbox
同语言下
.
Jquery搜索框获取回车事件
.
H5页面添加倒计时,然后自动跳转
.
通过user-agent判断h5页面是在哪个手机App(QQ、微信
.
nginx 禁止未绑定的域名访问
.
JavaScript 获取按键,并屏蔽系统 Window 事件
.
H5之只允许微信浏览器打开,禁止从外部浏览器访问
.
微信打开网址添加在浏览器中打开提示的办法
.
实现JS复制、粘贴,Chrome/Firefox下可用
.
video视频播放,play()、pause()、duration时长、onen
.
HTML5实现MP3上传前的预览和播放时长的获取
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
using
贡献的其它代码
(
7
)
.
微信公众平台 自定义菜单创建
.
排序面试题
.
MySQL存储过程实现split
.
结合checkbox动态产生tr可分页完整版
.
JAVA字符串编码转换常用类
.
JAVA JXL方式解析excel
.
JAVA 解析压缩包中的文件
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3