gpt4 book ai didi

GridView 中的 Jquery 日期?

转载 作者:行者123 更新时间:2023-12-01 05:43:39 26 4
gpt4 key购买 nike

I have included the jquery datepicker inside the item template, if I select the date from datepicker in the second row textbox (tbxEffectiveFromDate), selected date has been stored in the first row textbox only not in the selected Grid row index. Kindly resolves this jquery datepicker in the grid view. If I mentioned the textbox class name, it's not working.

<asp:UpdatePanel ID="MainUpdatePanel" runat="server">
<asp:GridView ID="gvBaseTarget" runat="server" CssClass="gvBaseTarget">
<Columns>
<asp:TemplateField ItemStyle-Width="18%" ItemStyle-CssClass="gvBaseTargetLeft" HeaderText="Effective From" HeaderStyle-CssClass="gvBaseTargetLeft">
<ItemTemplate>
<asp:TextBox ID="tbxEffectiveFromDate" runat="server" ReadOnly="true" ClientIDMode='Static' Enabled="false" Width="100px" CssClass="tbxBaseTarget"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:UpdatePanel>
$(document).ready(function () {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(bindPicker);
bindPicker();
});

function bindPicker()
{
var $gv = $("table[id$=gvBaseTarget]");
var $rows = $("> tbody > tr:not(:has(th, table))", $gv);
var $inputs = $("[id*=tbxEffectiveFromDate]", $rows);
$inputs.datepicker();
}

enter image description here

最佳答案

ClientIDMode='Static' 它将创建具有相同 id tbxEffectiveFromDate 的所有文本框。这可能是问题的原因。

尝试从代码中删除 ClientIDMode='Static'

关于GridView 中的 Jquery 日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29090564/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com