前台代码如下:
<script language="javascript" type="text/javascript" id="FpSpread1_Script2">
window.onload = function () {
var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
if (document.all) {
if (spread1.addEventListener) {
//IE9
spread1.addEventListener("CallBackStart", callBackStart, false);
spread1.addEventListener("ActiveCellChanged", cellChanged, false);
}
else {
//Other versions of IE and IE9 quirks mode (no doctype set)
spread1.onCallBackStart = callBackStart;
spread1.onActiveCellChanged = cellChanged;
}
}
else {
// Firefox
spread1.addEventListener("CallBackStart", callBackStart, false);
spread1.addEventListener("ActiveCellChanged", cellChanged, false);
}
}
function cellChanged(event) {
var rowno = event.row;
var colno = event.col;
alert("rows:" + rowno + ",cols:" + colno);
var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
alert(spread1.GetValue(rowno, colno - 1));
}
function CallBackStart(event) {
event.async = true;
}
</script> |