直接用ID获取dom元素就好了。有问题还是发新帖,不然这样不好跟踪,可以把老帖链接放到新帖中。
- <script language="javascript" type="text/javascript" id="FpSpread1_Script0">
- function FpSpread1_SelectionChanged(event) {
- var ss = FpSpread("FpSpread1");
- var c = ss.ActiveCol;
- var r = ss.ActiveRow;
- var cht = document.getElementById("FpSpread1_cht");
- var rh = document.getElementById("FpSpread1_rh");
- // 我们假设取列头中最后一行中单元格的值
- var cheader = cht.rows[cht.rows.length - 1].cells[c].innerText;
- var rheader = rh.rows[r].cells[rh.rows[r].cells.length - 1].innerText;
- alert("列头:" + cheader + " 行头:" + rheader);
- }
- </script>
复制代码 |