您好,经调研,该情况属于SpreadJS的设计,在SpreadJS中Shape拥有最高的zIndex,所以无论如何点击Shape下的单元格都只会选中Shape。
您可以尝试参考以下伪代码来实现:
- // listen click
- 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 in shapeArea) {
- // shapeArea couled be gotten by shape.startRow(), shape.endRow(), shape.startColumn(), shape.endColumn()... related method
- // then set sheet cell is selected and shape not selected
- sheet.setSelection(7, 10, 1, 2);
- shape.isSelected(false);
- }
- });
复制代码 |