我正在尝试用 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;
}