I'm having trouble showing just a single row inside a repeater. I have all of them expanding correctly, but my efforts to show just that row have not worked out well.
<asp:Repeater ID="rptPlayers" runat="server" OnItemDataBound="DataBound_ItemDataBoundEvent">
<HeaderTemplate>
<thead>
<tr>
<th>Name</th>
<th>Profile Approved?</th>
<th>Playing in <%: DateTime.Now.Year %>?</th>
<th>Roommate</th>
<th>Manage</th>
</tr>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tbody>
<tr>
<td><a href="#" class="show_hide"><%# Eval("FirstName") %> <%# Eval("LastName") %></a></td>
<td style="display: none"><%# Eval("PlayerEmail") %></td>
<td>
<asp:CheckBox ID="chkApproved" runat="server" Checked='<%# Eval("ProfileApproved") %>' /></td>
<td>
<asp:CheckBox ID="chkPlayingCurrentYear" runat="server" Checked='<%# Eval("PlayingCurrentYear") %>' /></td>
<td>
<asp:DropDownList ID="ddlRoommate" runat="server" AppendDataBoundItems="True"></asp:DropDownList>
<asp:LinkButton ID="lnkAssign" runat="server" OnClick="AssignPlayer"></asp:LinkButton></td>
<td>
<asp:PlaceHolder ID="AdminActions" runat="server"></asp:PlaceHolder>
<p class="text-danger">
<asp:LinkButton ID="lnkApproveProfile" runat="server" OnClick="ApprovePlayer"></asp:LinkButton>
<asp:LinkButton ID="lnkConfirm" runat="server" OnClick="ConfirmPlayer"></asp:LinkButton>
</p>
</td>
<td style="display: none">
<asp:Literal ID="ltUserId" runat="server" Text='<%# Eval("PlayerId") %>'></asp:Literal></td>
</tr>
<tr>
<td colspan="6">
<div class="slidingDiv">
Fill this space with really interesting content. <a href="#" class="show_hide">hide</a>
</div>
</td>
</tr>
</tbody>
</ItemTemplate>
</asp:Repeater>
This is my current jQuery, what am I missing to just toggle a single row?
<script type="text/javascript">
$(document).ready(function () {
$("div.slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function () {
$(".slidingDiv").slideToggle();
// $(this).next('div.slidingDiv').eq(0).slideToggle(800);
});
});
</script>
Aucun commentaire:
Enregistrer un commentaire