找回密码
 立即注册

QQ登录

只需一步,快速开始

angry003

中级会员

35

主题

119

帖子

512

积分

中级会员

积分
512

活字格认证微信认证勋章

angry003
中级会员   /  发表于:2016-3-3 11:03  /   查看:4167  /  回复:1
你好,我需要在鼠标悬浮某一行数据的时候,在当行数据边出现一点字段提示,是否有此类的方法? 3q

1 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2016-3-3 12:01:00
沙发
回复 1楼angry003的帖子

在MouseOver事件里去设置显示wijmo.Tooltip(show/hide方法展示和隐藏Tooltip)。
Tooltip类的API可以参考产品文档:
http://wijmo.com/5/docs/topic/wijmo.Tooltip.Class.html
参考代码:
  1.   // monitor the mouse over the grid
  2.             flex.hostElement.addEventListener('mousemove', function (evt) {
  3.                 var ht = flex.hitTest(evt);
  4.                 if (!ht.cellRange.equals(rng)) {
  5.                     // new cell selected, show tooltip
  6.                     if (ht.cellType == wijmo.grid.CellType.Cell) {
  7.                         rng = ht.cellRange;
  8.                         var cellElement = document.elementFromPoint(evt.clientX, evt.clientY),
  9.                             cellBounds = wijmo.Rect.fromBoundingRect(cellElement.getBoundingClientRect()),
  10.                             data = wijmo.escapeHtml(flex.getCellData(rng.row, rng.col, true)),
  11.                             tipContent = 'cell (' + rng.row + ' ' + rng.col + ') contains "<b>' + data + '</b>"';
  12.                         if (cellElement.className.indexOf('wj-cell') > -1) {
  13.                             tip.show(flex.hostElement, tipContent, cellBounds);
  14.                         } else {
  15.                             tip.hide(); // cell must be behind scroll bar...
  16.                         }
  17.                     }
  18.                 }
  19.             });
  20.             flex.hostElement.addEventListener('mouseout', function () {
  21.                 tip.hide();
  22.                 rng = null;
  23.             });
复制代码
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部