网格视图和JavaScript [英] Grid view and JavaScript

查看:56
本文介绍了网格视图和JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Javascript中获取所有选定的行数据以用于自定义设计的弹出窗口。我想将这些数据显示在弹出窗口中,但我无法将该数据绑定到我的文本框中。

How can i get all selected row data in the Javascript for custom designed popup window. i wants to show those data into a popup window , but i couldn't bind that data into my textbox.

推荐答案

您可以选择 CheckBox 供选择,或者您可以直接附加网格行的click事件。实际上, GridView 呈现为表格。因此,如果您分析 HTML ,您可以看到 tr td 等...



所以,你需要做的是处理Select CheckBox的检查事件或行的点击事件。在里面得到行和它的单元格值。然后在Popup中显示。



查看一些示例。

1. 使用JavaScript选择GridView行 [ ^ ]

2. 使用JavaScript点击时获取ASP.Net GridView SelectedRow [ ^ ]
Either you could have a Select CheckBox for selection or directly you can attach the click event for the Rows of Grid. Actually, the GridView renders as a Table. So, if you analyze the HTML, you can see the tr, td etc...

So, what you need to do is that handle the check event of Select CheckBox or the click event of rows. Inside that get the row and it's cell values. Then show in a Popup.

See some examples.
1. Using JavaScript To Select GridView Rows[^]
2. Get ASP.Net GridView SelectedRow when clicked using JavaScript[^]


这篇关于网格视图和JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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