行事件弹出消息不应显示在网格视图内的特定控件上。使用jquey [英] Row event popup message should not show on particular controls inside grid view. Using jquey
本文介绍了行事件弹出消息不应显示在网格视图内的特定控件上。使用jquey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我正在使用gridView,当我点击任意一行显示ID,Name等详细信息时,我使用了Rowevent pop消息。点击插入,删除,更新和页脚文本框弹出对话框并限制我执行操作。为此我使用了Jquery验证
我尝试过:
$( function (){
var grid = document .getElementById(' <%= gvDetails.ClientID%>');
$(' tr',grid).on(' click', function (){
$( #id)。html($( 。clsempid,$( this )。nearest( tr))。html());
$( #name)。html($( 。clsempid1,$( this )。nearest( tr))。html());
$( #department)。html($( 。clsempid2,$( this )。nearest( tr))。html());
$( #age)。html($( 。clsempid3,$( this )。nearest( tr))。html());
$( #sal)。html($( 。clsempid4,$( this )。nearest( tr))。html());
$( #dialog)。dialog()({
title : 员工详细信息,
按钮:{
确定: function (){
$( this )。dialog( ' close');
}
},
modal: true
})
});
});
我不希望验证这些控件
< asp:TemplateField HeaderText = 编辑/删除 HeaderStyle-Width = 5% >
< EditItemTemplate >
< asp:ImageButton ID = imgbtnUpdate CommandName = 更新 runat = < span class =code-keyword> server ImageUrl = 〜/ Images / update.png 工具提示 = 更新 高度 = 20px 宽度 = < span class =code-keyword> 20px / >
< asp:ImageButton ID = imgbtnCancel runat = server CommandName = 取消 < span class =code-attribute> ImageUrl = 〜/ Images / cancel.png 工具提示 = 取消 高度 = 20px 宽度 = 20px / >
< / EditItemTemplate >
< ItemTemplate >
< asp:ImageButton ID = imgbtnEdit CommandName = 编辑 runat = server ImageUrl = 〜/ Images / Insert.png < span class =code-attribute> 工具提示 = 编辑 高度 = 20px 宽度 = 20px / >
< asp:ImageButton ID = imgbtnDelete CommandName = 删除 文字 = 编辑 runat = 服务器 ImageUrl = 〜/ Images / delete.png 工具提示 = 删除 高度 = 10px 宽度 = 10px / >
< / ItemTemplate >
< FooterTemplate >
< asp:ImageButton ID = imgbtnAdd runat = server ImageUrl = 〜/ Images / Add.png CommandName = 添加 宽度 = 20px 高度 = 20px 工具提示 = 添加新用户 ValidationGroup = validaiton OnClientClick = GetGridFooterRowvalues() / >
< ; / FooterTemplate >
< / asp:TemplateField >
< FooterTemplate >
< asp:TextBox ID = txtempname1 runat = server AutoPostBack = false onkeypress = 仅返回Alpha(事件,此); / >
< asp:RequiredFieldValidator ID = rfvempname runat = server ControlToValidate = txtempname1 文字 = * ValidationGroup = validaiton / >
< / FooterTemplate >
解决方案
( function (){
var grid = document .getElementById(' <%= gvDetails.ClientID%>');
(' < span class =code-string> tr',grid).on(' click', function (){
( #标识跨度>)。HTML(
Hi
I am working on gridView and I have used Rowevent pop message when I click on any row to display the details like ID,Name etc..And clicking insert,Delete,Update and Footer textbox the dialog box popsup and restricts me from doing the actions.For this I have used Jquery validation
What I have tried:
$(function () {
var grid = document.getElementById('<%= gvDetails.ClientID%>');
$('tr', grid).on('click', function () {
$("#id").html($(".clsempid", $(this).closest("tr")).html());
$("#name").html($(".clsempid1", $(this).closest("tr")).html());
$("#department").html($(".clsempid2", $(this).closest("tr")).html());
$("#age").html($(".clsempid3", $(this).closest("tr")).html());
$("#sal").html($(".clsempid4", $(this).closest("tr")).html());
$("#dialog").dialog()({
title: "Employee Details",
buttons: {
Ok: function () {
$(this).dialog('close');
}
},
modal: true
})
});
});
I don't want the validation to these controls
<asp:TemplateField HeaderText="Edit/Delete" HeaderStyle-Width="5%">
<EditItemTemplate>
<asp:ImageButton ID="imgbtnUpdate" CommandName="Update" runat="server" ImageUrl="~/Images/update.png" ToolTip="Update" Height="20px" Width="20px" />
<asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/Images/cancel.png" ToolTip="Cancel" Height="20px" Width="20px" />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgbtnEdit" CommandName="Edit" runat="server" ImageUrl="~/Images/Insert.png" ToolTip="Edit" Height="20px" Width="20px" />
<asp:ImageButton ID="imgbtnDelete" CommandName="Delete" Text="Edit" runat="server" ImageUrl="~/Images/delete.png" ToolTip="Delete" Height="10px" Width="10px" />
</ItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="imgbtnAdd" runat="server" ImageUrl="~/Images/Add.png" CommandName="Add" Width="20px" Height="20px" ToolTip="Add new User" ValidationGroup="validaiton" OnClientClick="GetGridFooterRowvalues()" />
</FooterTemplate>
</asp:TemplateField>
<FooterTemplate>
<asp:TextBox ID="txtempname1" runat="server" AutoPostBack="false" onkeypress=" return onlyAlphabets(event,this);" />
<asp:RequiredFieldValidator ID="rfvempname" runat="server" ControlToValidate="txtempname1" Text="*" ValidationGroup="validaiton" />
</FooterTemplate>
解决方案
(function () { var grid = document.getElementById('<%= gvDetails.ClientID%>');
('tr', grid).on('click', function () {
("#id").html(
这篇关于行事件弹出消息不应显示在网格视图内的特定控件上。使用jquey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文