如何通过JavaScript取得表格内所有单元格的值
本帖最后由 xuehf_hz 于 2019-12-12 12:43 编辑按钮:
<asp:Button ID="cmdShow" runat="server" Text="Button"/>
表格
<wijmo:C1GridView ID="C1GridView1" runat="server" AllowVirtualScrolling="False" AutogenerateColumns="True" Culture="zh-CN" DataSourceID="SqlDataSource1" FreezingMode="None" RowHeight="19" ScrollMode="None" StaticColumnIndex="-1" StaticRowIndex="-1">
</wijmo:C1GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
下面的javaScript代码如何来写?
<script type="text/javascript">
function showTable() {
var i, j, strTemp;
for (i = 0; i <= C1GridView1.行数; i++) {
for (j = 0; j <= C1GridView1.列数; j++) {
strTemp = 取得表格当前行与列(i,j)的值;
alert(strTemp);
}
}
}
</script>
for (i = 0; i < C1GridView1.rows.length; i++) {
for (j = 0; j < C1GridView1.rows.cells.length; j++) {
var row = C1GridView1.rows;
strTemp = row.cells.textContent;
alert(strTemp);
}
} 我这边验证后给你结果 好的,谢谢 可以了,非常感谢!:) 不客气
页:
[1]