JavaScript获取GridView中用户点击控件的行号,列号
发布时间:2016-12-30 来源:查字典编辑
摘要:复制代码代码如下:functionopenOkurisakiPopup(obj){varrowIndex,co=objwhile(o.tag...
复制代码 代码如下:
<asp:ImageButton ID="BtnMailaddress" runat="server" ImageUrl="../img/Search.gif" ImageAlign="Top" TabIndex="0" OnClientClick = "javascript:openImage(this);return false;"/>
function openOkurisakiPopup(obj)
{
var rowIndex,c
o = obj
while(o.tagName != "TD")
o = o.parentNode
if(o.tagName != "TD") return
c = o.cellIndex
while(o.tagName != "TR")
o = o.parentNode
if(o.tagName != "TR") return
rowIndex = o.rowIndex
}
行号:rowIndex
列号: c