checkbox嵌套在repeater,gridview中的全选/反选(方法总结)
来源:互联网 发布:手机wifi网络连接超时 编辑:程序博客网 时间:2024/05/08 02:47
js:方法一:主checkbox选中,所有checkbox都选中
function SelectAll(box) { elm = document.forms[0]; for (i = 0; i < elm.length; i++) { if (elm[i].type == "checkbox" && elm[i].id != box.id) { if (elm.elements[i].checked != box.checked) { elm.elements[i].click(); } } } }方法二:主checkbox选中,名字为name的checkbox都被选中
function CheckAllCheckBox(obj, name) { var elements = document.forms[0].elements; for (var i = 0; i < elements.length; i++) { if (elements[i].type == 'checkbox') { if (elements[i].name.indexOf(name) > -1) { elements[i].checked = obj.checked; } } } }aspx页面:
<asp:Repeater ID="rptMent" runat="server" EnableViewState="false"> <HeaderTemplate> <div onmousemove="style.cursor = 'hand'" style="border: #93BEE2 1px solid; width: 100%;"> <table cellpadding="0px" cellspacing="0px" width="100%" class="dt" style="font-size: larger"> <tr align="center" style="background-image: url('Images/back.jpg')"> <td style="width:26px"><input id= "chkAll" type= "checkbox" onclick= "CheckAllGridCheckBox(this,'ckbFinish')"/></td> <td style="width: 26px">序号</td></tr> </table> </div> </HeaderTemplate> <ItemTemplate> <input type="hidden" name="ids" value='<%# Eval("N_Code") %>' /> <div id='<%# Eval("N_Code") %>' onclick="getValue(this)" ondblclick="GetOpen(this)" onmouseover="mouseOverMove(this,1)" onmouseout="mouseOverMove(this,2)" onmousedown="mouseOverMove(this,3)" style="width: 100%; border-left: #93BEE2 1px solid; border-right: #93BEE2 1px solid; border-bottom: #93BEE2 1px solid;"> <table cellpadding="0px" cellspacing="0px" width="100%;" class="dt"> <tr align="center"> <td style="width:26px"> <asp:Label runat="server" ID="lblCode" Visible="false" Text='<%# Eval("N_Code") %>'></asp:Label> <asp:CheckBox runat="server" ID="ckbFinish"/></td> <td style="width:26px"> <%# Container.ItemIndex + 1%></td></tr> </table> </div> </ItemTemplate></Repeater>
- checkbox嵌套在repeater,gridview中的全选/反选(方法总结)
- 在Repeater中实现CheckBox 的全选及反选
- ListView和CheckBox嵌套,全选,反选
- 学习“在多个表单中的checkbox全选、反选”
- 关于Repeater中嵌套GridView以及GridView中checkbox的全选功能的实例
- 遍历repeater中的CheckBox全选
- ListView中的CheckBox全选反选
- GridView中CheckBox实现全选或反选功能的方法
- checkbox全选反选
- checkbox 全选 反选
- checkbox全选反选
- checkbox,全选,反选
- checkbox全选反选
- GridView控件中模板列CheckBox全选、反选、取消
- gridview checkbox 多选 全选 全不选 反选 删除 实现
- GridView中嵌套Repeater方法
- GridView中嵌套Repeater方法
- 在Gridview中用CheckBox全选
- Linux上安装程序以及访问Win系统上的同享文件夹
- PL/SQL中基础操作(表空间、用户、表)
- UIViewAnimation动画与Core Animation的CATransition类动画
- ruby的加密库(md5/sha1/base64)
- mysql中文乱码,其实很简单
- checkbox嵌套在repeater,gridview中的全选/反选(方法总结)
- ssky-keygen + ssh-copy-id 无密码登陆远程LINUX主机【OK】
- jQuery因mouseover,mouseout冒泡产生的闪烁问题
- HTML解析利器HtmlAgilityPack
- ORACLE 基础知识
- 内存泄露相关文章
- 设置CButtonST按钮文字颜色
- 在自己的网页上添加分享功能
- 函数式编程扫盲篇