Home  >  Article  >  Web Front-end  >  Js 获取Gridview选中行的内容操作步骤_javascript技巧

Js 获取Gridview选中行的内容操作步骤_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:42:201508browse
复制代码 代码如下:

//取得gridview中获取选中行指定列的值
function Select()
{
//获取鼠标点击的元素
var e=eventsrcElement;
//获取元素所在的行的行号(表头行号从0开始)。注意:parentElement只适用于IE浏览器,而parentNode则符合DOM标准。
//var rowIndex=eparentElementparentElementrowIndex ;
var rowIndex=eparentNodeparentNoderowIndex ;
//获取GridView控件
var gdview=documentgetElementById("");
//分别获取选定行指定列的值
var value=gdviewrows(rowIndex)cells(列号)innerText;
}

获取选中行的内容方法
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn