且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将单个Dojo Tooltip动态分配给多个节点

更新时间:2023-02-11 18:11:50

你可以为工具提示做这样的事情
记住,你需要在你的窗口小部件定义中需要 dojo / query

You could do something like this for the tooltip. Remember you need to require dojo/query in your widget definition.

postCreate: function() {
  var _this = this;
  var containerNode = this.domNode; // Assuming that the widget has a domNode

  var fooTooltip = new Tooltip({
     connectId: query('.list-container', containerNode ), // Search the Node starting at the containerNode.
     selector: '.list-container-item',
     getContent: function(matchedNode) {
        console.debug('this is a tooltip for ', matchedNode);
     }
  });

}