捕获菜单位置,并在创建后编辑菜单
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个菜单都有一个属性 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.