如何使用JavaScript获取嵌套数据网格的单元格值 [英] How to get the cell value of a nested data grid using JavaScript

查看:55
本文介绍了如何使用JavaScript获取嵌套数据网格的单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要使用Java脚本获取嵌套数据网格的单元格值.任何人都可以给我建议.

Hi,

I need to get the cell values of nested data grid using java script. Can any one give me the suggestion.

推荐答案

您可以尝试以下方法:
1.选中一个复选框.
2.单击JQuery代码下面的复选框后,将为您提供单元格值:
You can try this:
1. Put a checkbox.
2. On clicking of checkbox below JQuery code will give you the cell value:


(ctrl).parents(' tr').children().filter(function(index){ 返回索引== 1 ; }).html()
(ctrl).parents('tr').children().filter(function(index) { return index == 1; }).html()



注意:我认为所需的单元格紧接在复选框之后(因此索引= 1).您也可以使用任何控件代替复选框.



Note: I''ve considered that the required cell is imediately after the checkbox (hence index = 1). Also you can use any control in place of checkbox.


这篇关于如何使用JavaScript获取嵌套数据网格的单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆