开发者

How to get a child control from a Tr?

开发者 https://www.devze.com 2023-02-26 11:33 出处:网络
I have a hidden field in each Tr in my template: <ItemTemplate> <tr style=\"\" class=\"ui-selectee trClass ui-widget-content\">

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 );
});
0

精彩评论

暂无评论...
验证码 换一张
取 消