我有3级嵌套转发器,如代码所示。
第二个(RpMenu
)转发器有复选框,应该检查第三个复选框(RbItems
)。
如何使用JQuery执行此操作?
<asp:Repeater ID="RpGroups" runat="server" OnItemDataBound="RpGroups_ItemDataBound">
<ItemTemplate>
<asp:Label ID="GID" runat="server" Text='<%# Eval("groupid")%>' Visible="false"> </asp:Label>
<div class="panel panel-primary ">
<a class="accordion-toggle" data-toggle="collapse" href="#<%# Eval("groupid")%>">
<div class="panel-heading">
<h3 class="panel-title"><%# Eval("groupName")%> </h3>
</div>
</a>
<div class="panel-body ">
<div class="accordion-body collapse" id="<%# Eval("groupid")%>">
<asp:Repeater ID="RpMenu" runat="server" OnItemDataBound="FillMenuItems">
<ItemTemplate>
<div class="panel panel-red">
<div class="panel-heading">
<h3 class="panel-title" style="text-align: center"><%# Eval("HeadItemText")%>
<div class="navbar-right"></div>
</h3>
</div>
<div class="panel-body">
<asp:Label ID="Label1" runat="server" Text='<%# Eval("HeaderMenuId")%>' Visible="false"></asp:Label>
<table class="table table-striped ">
<thead>
<tr class="alert-danger">
<th></th>
<th class="col-sm-2 control-label">Page Name</th>
<th>
<input id="Checkbox1" type="checkbox" value="Full Add" runat="server" onclick="checkadd()" />Full Add</th>
<script type="text/javascript">
function checkadd() {
if (document.getElementById('Checkbox1').checked) {
}
else {
}
}
</script>
<th>
<input id="Checkbox2" type="checkbox" value="Full View" onclick="checkview()" />Full View</th>
<script type="text/javascript">
function checkview() {
if (document.getElementById('Checkbox2').checked) {
}
else {
}
}
</script>
<th>
<input id="Checkbox3" type="checkbox" value="Full Updte" onclick="checkupdat()" />Full Updte</th>
<script type="text/javascript">
function checkupdat() {
if (document.getElementById('Checkbox3').checked) {
}
else {
}
}
</script>
<th>
<input id="Checkbox4" type="checkbox" value="Full Delete" onclick="checkdelet()" />Full Delete</th>
<script type="text/javascript">
function checkdelet() {
if (document.getElementById('Checkbox4').checked) {
}
else {
}
}
</script>
</tr>
</thead>
</table>
<asp:Repeater ID="RbItems" runat="server">
<ItemTemplate>
<div class="table-responsive">
<table class="table table-striped table-hover">
<tr class="view">
<td>
<asp:Label ID="PID" runat="server" Text='<%# Eval("tblMenuItemID")%>' Visible="false"></asp:Label></td>
<td class="col-sm-2 control-label"><strong>
<div><%# Eval("MenuItemName")%></div>
</strong></td>
<td>
<asp:CheckBox ID="Add" runat="server" Text="Add" /></td>
<td>
<asp:CheckBox ID="View" runat="server" Text="View" /></td>
<td>
<asp:CheckBox ID="Edit" runat="server" Text="Update" /></td>
<td>
<asp:CheckBox ID="Delete" runat="server" Text="Delete" /></td>
</tr>
</table>
</div>
<%-- <li>
<a href="<%# Eval("MenuItemLink")%>"><%# Eval("MenuItemName")%></a>
</li>--%>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
我需要在检查'Checkbox1'时,检查转发器3中名为'Add'的所有复选框。