I have a hidden field in each Tr
in my template:
<ItemTemplate>
<tr style="" class="ui-selectee trClass ui-widget-content">
<td style="width: 100px">
<asp:HiddenField ID="idField" runat="server" Value='<%# Eval("Id") %>' />
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
</td>
<td>
<asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
</td>
<td>
<asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>开发者_StackOverflow社区' />
</td>
</tr>
</ItemTemplate>
No, in the each
loop on the selected Tr
, how can I get the hidden field ?
$(".ui-selected", this).each(function () {
var index = $(".selectable tr").index(this);
var idField = ??
});
I've already started with:
var idField = $(".selectable tr > [id*='idField']");
But seems it does not work!
Any help!
var id = $('tr.ui-selectee td input[type="hidden"]').val();
try this...
$(".ui-selected", this).each(function () {
var index = $(this).find('#idField').val();// use common class for hidden field,that would be good.
alert(index );
});
精彩评论