你好,这是由于e.toElement.innerText返回的值不对,不能通过这样的方式来获取信息,
Wijmo有专用的getCellData方法,参考附件示例。
关键代码如下:
- workersGrid.hostElement.addEventListener('mouseover', function(e) {
- var ht = workersGrid.hitTest(e);
- if (ht.panel) {
- // var cellValue = ht.panel.getCellData(ht.row, ht.col);
- var cellValue = ht.panel.getCellData(ht.row, ht.col);//e.toElement.innerText
- console.log(e);
- var cellValueSize = textSize(cellValue);
- var cellWith = ht.grid.columns[ht.col].renderWidth;
-
- var newTip = wijmo.format('{val}', {
- panel: wijmo.grid.CellType[ht.cellType],
- row: ht.row,
- col: ht.col,
- val: cellValue
- });
- if (newTip !== tip) {
- tip = newTip;
- tt.show(ht.panel.hostElement.parentElement, tip, ht.panel.getCellBoundingRect(ht.row, ht.col));
- }
- } else {
- tt.hide();
- tip = '';
- }
- });
复制代码
|