如何在javascript中访问gridview项模板的控件 [英] How to access gridview item template's controls in javascript
本文介绍了如何在javascript中访问gridview项模板的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在javascript中访问gridview项目模板的控件?
提前致谢
解决方案
Gridview在WebBrowser中呈现为Table。所以你可以使用表格行访问控件。
喜欢
< script type = text / javascript>
var table = document .getElementById( GridView1);
if (table.rows.length> 0 ){
for ( var i = 1 ; i< table.rows.length; i ++)
{
var elements = table.rows [i] .getElementsByTagName( input);
}
}
< / script>
使用javascript查找带有gridview的控件的id [ ^ ]
在Javascript中查找GridView内的控件? [ ^
How to access gridview item template's controls in javascript ?
Thanks in advance
[edit]SHOUTING removed - OriginalGriff[/edit]
解决方案
Gridview is rendered as Table in WebBrowser. so you can access the controls using table rows.
like
<script type="text/javascript"> var table = document.getElementById("GridView1"); if (table.rows.length > 0) { for (var i = 1; i < table.rows.length; i++) { var elements= table.rows[i].getElementsByTagName("input"); } } </script>
find a id for a control withing a gridview using javascript[^]
Find Control Inside GridView in Javascript?[^]
这篇关于如何在javascript中访问gridview项模板的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文