How to set the location a Dojo Dialog opens at?

2019-06-26 17:14发布

I have a Dojo dialog that is opened when a user clicks on an element on the page.

I want control the location it opens at ....really I want it to open beside (relative to) the other dom element clicked on.

But I can seem to figure out how to do either of the above.

Thank for any advice.

2条回答
Explosion°爆炸
2楼-- · 2019-06-26 17:31

I'd take a loot at the Tooltip doc for Dojo. I've never had experience with Dojo, but here are some links that should help you get started.

Dojo Dijit Dialog relative position. is it possible?

http://livedocs.dojotoolkit.org/dijit/TooltipDialog

http://mail.dojotoolkit.org/pipermail/dojo-interest/2011-May/054581.html

查看更多
看我几分像从前
3楼-- · 2019-06-26 17:39

Open an dialog with dojo relative to click position:

dojo.style(pointDialog.domNode, 'visibility', 'hidden');
pointDialog.show().then(function () {
    dojo.style(pointDialog.domNode, 'top', clickEvt.pageY);
    dojo.style(pointDialog.domNode, 'visibility', 'visible');
});

The visibility trick is needed for dialog not hop

查看更多
登录 后发表回答