js获取GridView中行数据的两种方法
来源:互联网 发布:python 马科维兹模型 编辑:程序博客网 时间:2024/05/22 13:55
第一种方法:
function submitData() {
var tb = document.getElementById(IDArray[0]); //获取服务器控件GridView的ID
if (tb)
{
var rows = tb.rows;
for (var i = 1; i < rows.length; i++) {
var id = rows[i].cells[1].innerText;
var name = rows[i].cells[2].innerHTML;
var oDropDownList = rows[i].cells[3].childNodes[0];
var oText = oDropDownList.options[oDropDownList.selectedIndex].text; //获取GridView中下拉列表中选中的文本
var oValue = oDropDownList.options[oDropDownList.selectedIndex].value;; //获取GridView中下拉列表中选中的值
}
}
}
第二种方法:
function submitData() {
var tb = document.getElementById(IDArray[0]);
if (tb.hasChildNodes) {
if (tb.childNodes[0] != null) {
var rowCount = tb.childNodes[0].childNodes.length;
for (var i = 1; i < rowCount; i++) {
var child = tb.childNodes[0].childNodes[i];
var id = rowCount[i].cells[1].innerHTML;
var name = child.childNodes[1].innerHTML;
var oDropDownList = child.childNodes[2].childNodes[0];
var oText = oDropDownList.options[oDropDownList.selectedIndex].text;
var oValue = oDropDownList.options[oDropDownList.selectedIndex].value
}
}
}
- js获取GridView中行数据的两种方法
- js获取GridView中行数据的两种方法
- Ext 获取grid中选中行的数据
- gridview获取数据列的几种方法.txt
- 获取jqGrid中选中行的数据以及 jqGrid获得所有行数据的方法
- js获取表单值的两种方法
- 关于JS获取select值的两种实现方法
- js获取表单值的两种方法
- js获取表单值的两种方法
- easyui获取数据表格中选中行的数据
- EasyUI datagrid数据表格--获取datagrid中选中行的数据
- GridView 遍历的两种方法
- GridView实现分页的两种方法
- s:iterator获取Bean中数据的两种方法
- Unity3D获取web数据的两种方法
- ORACLE 获取同期数据的两种方法
- 获取网上数据的两种方法HttpURLConnection和HttpClient
- 数据获取的两种方法:DataList和SqlDataReader
- 部分函数列举
- 《华为研发》阅读 - 15 (分解“满汉全席”,“先谋而后动”)
- CreateEvent、CreateSemaphore、ReleaseSemaphore、CreateMutex
- sicily 1765
- 数据结构--二叉树
- js获取GridView中行数据的两种方法
- 如何交叉编译Python到ARM-Linux平台
- 如何:在 Visual Studio 中添加或移除引用
- 实时操作系统与通用操作系统的一些比较
- BTree,B-Tree,B+Tree,B*Tree
- 《满江红》
- Ubuntu Locale配置问题根源解决之道
- 图像 ROI
- 一辈子都应该记住的话