捕获菜单位置,并在创建后编辑菜单

发布于 2024-08-06 07:13:14 字数 253 浏览 1 评论 0原文

我正在使用 dijit.Menu 小部件,但我不知道如何做一些事情:

  • 如何捕获 dijit 上下文菜单左上角的位置?
  • 我怎么知道女巫圆顶节点属于 dijit 菜单(为此,我将 DOM 节点 id 写入菜单,然后使用 dojo.byId 找到它,但我不认为它是最好的方法)
  • 我怎样才能从根本上改变菜单,换句话说,我需要创建一个菜单,一段时间后我需要添加一些子菜单。

I'm working with the dijit.Menu widget, but I don't know how to do some things:

  • How can I catch te position of the top left corner of a dijit context menu?
  • How can I know witch dome node belongs to the dijit menu, (to do that I write into the menu the DOM node id and I find it with dojo.byId, but I don't think its the best way)
  • How can I dinamycally change a menu, in other words I need to create a menu and some time after I need to add some submenus.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧时浪漫 2024-08-13 07:13:14

每个菜单都有一个属性 domNode,该属性链接到用于显示菜单的顶级 DOM 节点。查看 api

Each menu has a property domNode that is linked to the top-level DOM node used to display the menu. Check out the api.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文