如何在JavaScript中获取当前选定的GridView单元格 [英] how to get current selected gridview cell in javascript
本文介绍了如何在JavaScript中获取当前选定的GridView单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi ..
我正在尝试访问javascript.provide soln.thanx
hi..
I am trying to access current selected gridview cell in javascript.provide soln.thanx
推荐答案
您好,Vijay,
中当前选择的gridview单元. 您可以点击此链接.实际上,它与jquery有关.
http ://api.jquery.com/category/selectors/?rdfrom = http%3A%2F%2Fdocs.jquery.com%2Fmw%2Findex.php%3Ftitle%3DSelectors%26redirect%3Dno [ ^ ]
此处提供了各种选择器.希望对您有用.
Hi Vijay,
U can follow this link. Actually it is related to jquery.
http://api.jquery.com/category/selectors/?rdfrom=http%3A%2F%2Fdocs.jquery.com%2Fmw%2Findex.php%3Ftitle%3DSelectors%26redirect%3Dno[^]
Different kinds of selectors are given here. Hope it is useful for u.
Vijay,
请查看此链接.......
http://jquerybyexample.blogspot.com/2012/05/get-aspnet-gridview-cell-value-on-click.html [
Hi Vijay,
Kindly look into this link.......
http://jquerybyexample.blogspot.com/2012/05/get-aspnet-gridview-cell-value-on-click.html[^]
This might be very useful then previous one.
yeeeeeeeeeeeeeeeee ............................. ..............
我得到了答案
javascript代码
var gdv = document.getElementById(''gridviewId'');
var activeCell = gdv.document.activeElement.cellIndex;
var activeRowIndex = gdv.document.activeElement.parentElement.rowIndex;
因此我在activeRowIndex行中选择的单元格具有单元格索引activeCell
yeeeeeeeeeeeeeee...........................................
i got answer
javascript code
var gdv=document.getElementById(''gridviewId'');
var activeCell=gdv.document.activeElement.cellIndex;
var activeRowIndex=gdv.document.activeElement.parentElement.rowIndex;
so my selected cell in activeRowIndex row with cell index activeCell
这篇关于如何在JavaScript中获取当前选定的GridView单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文