每次单击单元格后触发脚本事件IE10问题
事件过程:每次单击单元格后触发脚本事件
在IE11下能正常运行,IE10下无效,麻烦看一下!
window.onload = function () {
var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
spread1.addEventListener("CellClicked", cellClicked, false);
}
function cellClicked() {
Alert(1);
App.direct.FpSpread1_CellClick(event.row, event.col);//后台方法,此处可不关注
}
按照 下面的写法去写
<script lang="javascript" type="text/javascript">
window.onload = function () {
var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
if (document.all) {
// IE
if (spread1.addEventListener) {
// IE9
spread1.addEventListener("CellClicked", cellClicked, false);
} else {
// Other versions of IE and IE9 quirks mode (no doctype set)
spread1.CellClicked = cellClicked;
}
}
else {
// Firefox
spread1.addEventListener("CellClicked", cellClicked, false);
}
}
function cellChanged(event) {
alert("r"+event.row+",c"+event.col);
}
</script>
本帖最后由 gsyxy100 于 2017-7-20 17:38 编辑
IE10下没有响应,alert(1);消息出现,但点击单元格后没有响应,麻烦帮我调试一个DEMO,谢谢!
window.onload = function () {
var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
if (document.all) {
// IE
if (spread1.addEventListener) {
// IE9
alert(1);
spread1.addEventListener("CellClicked", cellClicked, false);
//spread1.addEventListener("ActiveCellChanged", cellChanged, false);
} else {
// Other versions of IE and IE9 quirks mode (no doctype set)
alert(2);
spread1.CellClicked = cellClicked;
}
}
else {
// Firefox
alert(3);
spread1.addEventListener("CellClicked", cellClicked, false);
}
}
function cellClicked() {
App.direct.FpSpread1_CellClick(event.row, event.col);
}
function cellChanged(event) {
App.direct.FpSpread1_CellClick(event.row, event.col);
} ActiveCellChanged(单元格改变)测试可以,但我的需求是每次点击触发!:( 您的问题收到了,我需要在IE10 的环境去测试下。
另外您是开发环境还是部署环境测试的,如果是部署后?
如果是部署,您看下
http://www.gcpowertools.com.cn/products/spread_aspnet_knowledge.htm
怎样在服务器上部署 Spread for ASP.NET
环境正常,但不能正常部署 部署环境和开发环境同样的问题。 明白了,我们这边会再测试下给您答复
页:
[1]