[重新发布]如何在gridview中找到控件的id,gridview在hjavascript中的父gridview内 [英] [Repost]how to find id of control inside gridview and the gridview is inside parent gridview in hjavascript
本文介绍了[重新发布]如何在gridview中找到控件的id,gridview在hjavascript中的父gridview内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var ParentGrid = document.getElementById(<%= gvParentGrid.ClientID%>);
var ParentGrid = document.getElementById("<%= gvParentGrid.ClientID %>");
var chidgridVal1 = document.getElementById('ctl00_MainContent_gvParentGrid_ctl02_gvChildGrid');
var chidgridVal2 = document.getElementById('ctl00_MainContent_gvParentGrid_ctl03_gvChildGrid');
var chidgridVal3 = document.getElementById('ctl00_MainContent_gvParentGrid_ctl04_gvChildGrid');
不使用'ctl00_MainContent_gvParentGrid_ctl02_gvChildGrid'如何获取网格
without using 'ctl00_MainContent_gvParentGrid_ctl02_gvChildGrid' how can i get the id of control for grid
推荐答案
你可以通过使用JQuery找到
You can find by use JQuery
( #GridviewID tbody)。find(' < span class =code-string> tr')。each( function (i){
var text =
("#GridviewID tbody").find('tr').each(function (i) { var text =
( this )。find( input [type ='input'])[ 0 ];
});
(this).find("input[type='input']")[0]; });
上面的循环将找到网格的每一行,下面的代码是找到行中的第一个文本框。
The above loop will find each row of grid and the below code is to find the first textbox in the row.
// if u need nth textbox of the row give nth-1 as the index
var text =
这篇关于[重新发布]如何在gridview中找到控件的id,gridview在hjavascript中的父gridview内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文