//增加单击事件
spread.getHost().addEventListener('click', function(e){
var y = e.pageY - this.offsetTop;
var x = e.pageX - this.offsetLeft;
var result = spread.hitTest(x, y);
if (result) {
var worksheetHitInfo = result.worksheetHitInfo;
var tabStripHitInfo = result.tabStripHitInfo;
var strtabStrip = "";
if (tabStripHitInfo.navButton) {
strtabStrip = tabStripHitInfo.navButton;
} else if (tabStripHitInfo.sheetTab) {
strtabStrip = tabStripHitInfo.sheetTab.sheetName;
} else if (tabStripHitInfo.resize === true) {
strtabStrip = "resize";
} else {
strtabStrip = "blank";
}
alert(strtabStrip);
}
});
单击下面的sheet页签格式时result返回null无法操作是什么原因 |