JavaScript获取每个gridview行的CheckBoxList值。 [英] JavaScript to get CheckBoxList values for each gridview row.

查看:73
本文介绍了JavaScript获取每个gridview行的CheckBoxList值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview,其中显示了我们从客户收到的产品投诉的详细信息。

每当我们对投诉采取行动时,我们有时会更换几个部分的产品,为此我有一个复选框列表我的Gridview专栏没有。每排7个。这个CheckBoxList包含可替换的部分,每个投诉可以选择多个部分(每行)。



我想编写一个可循环遍历每个gridview行的javascript当我在第7列中选择chekcboxlist项目时,它会在每个gridview行的第8列的标签上显示它们。

所以基本上我需要编写一个javascript,每个gridview都有一个循环行然后循环读取每个行的复选框列表选定的项目。



请帮助我无法编写那个javascript,还请告诉我应该怎样以及我应该在哪里叫那个javascript。

提前谢谢。

I have a gridview in which i show details of products complaints we receive from customer.
Whenever we take action on complaints we sometimes replace few parts of products, for this purpose i have a checkboxlist in my Gridview column no. 7 for each row. This CheckBoxList contains replaceable parts and one can select more than one part for each complaint (each row).

I want to write a javascript which can loop through each gridview row and as soon as i select the chekcboxlist items in 7th column it shows them on a label in column no 8 for each gridview row.
So basically i need to write a javascript which has a loop for each gridview row and then a loop to read checkboxlist selected items for each row.

Please help i am not able to write that javascript, also please tell me how and where should i call that javascript.
Thanks in advance.

推荐答案

首先。 GridView是一个asp控件。它有一些属性,如ID和DataSource等,但这些只是工具。最后(与所有asp控件一样)它呈现为html。



控件渲染过程逐字逐句地将html写入响应中。



Javascript并不关心DataGrid是什么,因为javascript在呈现页面后在客户端浏览器上运行。它永远不会看到DataGrid。



它将看到的是已呈现的html。



DataGrid(通常)渲染到表格。



在浏览器中打开页面并查看页面源html。找到你已经渲染的控件。 id将类似于ct100
First up. GridView is an asp control. It has some properties like ID and DataSource etc but these are just tools. In the end (as with all asp controls) it renders to html.

The control render process literally writes html line by line to in the response.

Javascript doesn't care what a DataGrid is because javascript runs on the client browser after the page has been rendered. It will never see a DataGrid.

What it will see is the html that has been rendered.

DataGrid (usually) renders to a table.

Open up the page in a browser and view the page source html. Find your control as it has been rendered. The id will be something like ct100


MyPanel


MyGridView。



你的javascript将不得不解析这张桌子。



我希望能让你开始。



如果你需要帮助在javascript中解析html表格,请接受这个解决方案并发布一个新问题



祝你好运^ _ ^
MyGridView.

Your javascript will have to parse this table.

I hope that gets you started.

Please accept this solution and post a new question if you need help parsing the html table in javascript

Good luck ^_^


这篇关于JavaScript获取每个gridview行的CheckBoxList值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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