可以捕捉mousemove事件,下面代码仅供提供思路:
spread.getHost().addEventListener('mousemove', function(e){
var spreadOffset = $(spread.getHost()).offset();
var x = e.pageX - spreadOffset.left;
var y = e.pageY - spreadOffset.top;
var result = spread.hitTest(x, y);
if (result && result.worksheetHitInfo) {
var worksheetHitInfo = result.worksheetHitInfo;
var row = worksheetHitInfo.row;
var col = worksheetHitInfo.col;
//设置对应行的颜色高亮,并恢复之前行的底色。
}); |