Home  >  Article  >  Web Front-end  >  Js steps to get the content of the selected row in Gridview_javascript skills

Js steps to get the content of the selected row in Gridview_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:42:201542browse
Copy the code The code is as follows:

//Get the value of the specified column of the selected row in the gridview
function Select()
{
//Get the element clicked by the mouse
var e=eventsrcElement;
//Get the row number of the row where the element is located (the header row number starts from 0). Note: parentElement is only applicable to IE browser, while parentNode complies with DOM standards.
//var rowIndex=eparentElementparentElementrowIndex;
var rowIndex=eparentNodeparentNoderowIndex;
//Get the GridView control
var gdview=documentgetElementById("<%=gdviewClientID %>");
/ /Get the value of the specified column of the selected row respectively
var value=gdviewrows(rowIndex)cells(column number)innerText;
}

Get the content method of the selected row
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