所以基本上我是一个新手,当谈到道场只有第二天使用它但我尝试了一切,似乎不能让这个子菜单工作,基本上我有一个上下文菜单为我的dgrid列头工作正常子菜单不会显示的事实,以及我遇到的第二个问题是上下文菜单不会在鼠标上打开,而是在网页或应用程序的底部,任何机构都有任何想法?
here is a live version of the application
var activeMenuItem;
grid.on('.dgrid-column-goals:contextmenu', function(evt) {
evt.preventDefault();
});
require([
"dijit/Menu",
"dijit/MenuItem",
"dijit/CheckedMenuItem",
"dijit/MenuSeparator",
"dijit/PopupMenuItem",
"dojo/domReady!"
],function(Menu,MenuItem,CheckedMenuItem,MenuSeparator,PopupMenuItem){
var menu = new Menu({
targetNodeIds: [grid.domNode],
selector: ".dgrid-column-goals"
});
menu.addChild(new MenuItem({
label: "Hide Column",
onClick: function() {grid.styleColumn("goals", "display: none;");} }
));
var submenu = new Menu({
label: "Alignment"
});
submenu.addChild(new MenuItem({
label: "Alignment-Right",
onClick: function() {grid.styleColumn("number", "text-align:right");} }
));
});
答案 0 :(得分:0)
通过添加以下css修复任何人遇到同样的问题。
.dijitPopup {
position: absolute;
}