使用JavaScript获取Gridview单元格值 [英] Get Gridview Cell Value using JavaScript
本文介绍了使用JavaScript获取Gridview单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带复选框列的gridview,我可以确定是否选中了一行.我的问题是我无法获得单元格的值.我正在使用javascript.我正在使用JS,因为一旦获得单元格值,我就必须进行ajax调用.提前谢谢.这是我的代码:
I got a gridview with a checkbox column, which I''m able to determine whether a row is checked. My problem is that I can''t get the cell value. I''m using javascript. I''m using JS since I have to make an ajax call once I get the cell value. Thx in advance. Here''s my code:
function newData(mode) {
if (mode == 'edit') {
var valid = false;
var gv = document.getElementById("myGridview");
for (var i = 0; i < gv.all.length; i++) {
var node = gv.all[i];
if (node != null && node.type == "checkbox" && node.checked) {
valid = true;
break;
}
}
if (!valid) {
alert("Invalid. Please select a checkbox to continue.");
}
return valid;
}
推荐答案
看看类似的线程:
使用javascript获取gridview单元格数据 [此处 [
Have a look on similar thread:
get gridview cell data using javascript[^]
..and more here[^]
这篇关于使用JavaScript获取Gridview单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文