0

我正在尝试用 Dojo 实现 TooltipDialog,虽然对话框显示得很好,但我仍然不知道如何更改提示的内容,我的代码如下:

var _tipContent;

require([
        "dijit/TooltipDialog",
        "dijit/popup",
        "dojo/on",
        "dojo/dom",
        "dojo/domReady!"
    ], function (TooltipDialog, popup, on, dom) {
        var myTooltipDialog = new TooltipDialog({
            id: 'myTooltipDialog',
            style: "width: 300px;",
            content: _tipContent,
            onMouseLeave: function () {
                popup.close(myTooltipDialog);
            }
        });

        on(dom.byId('TriggerBlock'), 'mouseover', function () {
            popup.open({
                popup: myTooltipDialog,
                around: dom.byId('TriggerBlock')
            });
        });
    });

function onMouseOverGraphics(sender, eventArgs) {
  _tipContent = "I wanna change the tip's content according to the current position, the x coordinate: " + eventArgs.clientX;

}

4

1 回答 1

1

尝试改用这个:

dijit.showTooltip("This is the tool tip content",
     //this is the dom where you want the tooltip to show
     select.domNode,
     //this is an attribute to get where the tooltip of the dom
     select.get('tooltipPosition'),
     //this is the position or the side of where the tooltip will sho
     !select.isLeftToRight()
     );
于 2013-09-18T08:22:30.797 回答