使用jQuery检查在Repeater中取消选中复选框 [英] Check Uncheck Checkbox inside a Repeater Using jQuery

查看:59
本文介绍了使用jQuery检查在Repeater中取消选中复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我们的代码如下所示我们想要检查转发器内的所有复选框,即'cbRupees'使用 jquery 检查复选框'CheckAll'请帮助.....



 < ;  表格 >  
< tr >
< th > < ; / th >
< th > B < ; / th >
< th > C < ; / th >
< th > D < / th >
< th > < asp:CheckBox ID = CheckAll runat = server CssClass = cbheader / > < / th >
< ; / tr >
< asp:Repeater runat = server < span class =code-attribute> ID = rptrFeeDetails >
< ItemTemplate >
< tr >
< td > <% #Eval( )%> < < span class =code-leadattribute> / td >
< td > <%# Eval( B)%> < / td >
< ; td > <% #Eval( C)%> < / td >
< td > <% #Eval( D)% > < / td >
< td >
< div >
< as p:CheckBox ID = cbRupees runat = 服务器 CssClass = cbLevel / >
< / div >
< / td >
< / tr >
< / ItemTemplate >
< / asp:Repeater >
< / table >

解决方案

我会使用jQuery的CSS类来识别复选框,因为元素ID已构建动态来自服务器端。



 


document )。ready( function (){


' .cbheader')。on(' 点击'功能(e) {

Hello Our Code is as below just we want check all the checkbox inside repeater i.e.'cbRupees' using jquery on check of checkbox 'CheckAll'. Any help please.....

<table>
    <tr>
        <th>A</th>
        <th>B</th>
        <th>C</th>
        <th>D</th>
        <th><asp:CheckBox ID="CheckAll" runat="server" CssClass="cbheader"/></th>
    </tr>
    <asp:Repeater runat="server" ID="rptrFeeDetails">
        <ItemTemplate>
            <tr>
                <td><%#Eval("A") %></td>
                <td><%#Eval("B") %></td>
                <td><%#Eval("C") %></td>
                <td><%#Eval("D") %></td>
                <td>
                    <div>
                        <asp:CheckBox ID="cbRupees" runat="server" CssClass="cbLevel"/>
                    </div>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>

解决方案

I would use the CSS classes for jQuery to identify the checkboxes, since the element IDs are built dynamically from the server side.


(document).ready(function() {


('.cbheader').on('click', function(e) {


这篇关于使用jQuery检查在Repeater中取消选中复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆