jquery – 在其中查找嵌套的Gridview和控件
需要帮助找到嵌套的Gridview和控件,例如使用jquery标签
我在下面进行计算的中间是jquery代码。
$("#").each(function () { //hardcoded control id of parent gridview $(this).find('span[id$="gvSupplierList_lblsizeofopt_0"]').text('0.01'); //hardcoded control id of child/nested gridview $("#gvSupplierList_gvCustomerList_0 > tbody > tr").each(function () { //hardcoded control id of child/nested control $(this).find('input[id$="gvSupplierList_gvCustomerList_0_txtsizeofopt_0"]').val(); }); });
提前致谢。
您需要使用FindControl向上导航控制树并在子GridView的行中找到正确的TextBox。
在此片段中,将找到子项的父行和第2行中的TextBox,并设置文本集。
或者,如果你知道jQUewry中的两行,你也可以这样做