在源代码调试模式下JS是有效的,23列单元格填写价格 失去焦点会计算得出总价,写在24列里面。程序发布后,23列填写价格失去焦点后,JS不执行连alert("TE")都不会弹出信息。请问是什么原因引起的呢?
<script language="javascript" type="text/javascript" id="FpSpread1_Script0">
function FpSpread1_EditStopped(event) {
//Add code to handle your event here.
alert(" TE ");
var spread = this.document.getElementById("FpSpreadGV");
var activecol = spread.GetActiveCol();
var activeRow = spread.GetActiveRow();
if (activecol == 23 && spread.GetValue(activeRow, 23).length > 0) {
var usage = parseFloat(spread.GetValue(activeRow, 5));
var price = parseFloat(spread.GetValue(activeRow, 23));
if (usage > 0) {
spread.SetValue(activeRow, 24, usage * price, true);
}
else {
var itemNo = parseFloat(spread.GetValue(activeRow, 0));
var rc = spread.GetRowCount();
for (var i = 0; i < rc - 1; i++) {
var value = parseFloat(spread.GetValue(i, 0));
usage = parseFloat(spread.GetValue(i, 5));
if (value == itemNo && usage > 0) {
spread.SetValue(activeRow, 24, usage * price, true);
break;
}
}
}
}
}
</script>
|
|