dhtmlXTree v2.1 Pro. and dhtmlXMenuObject context menu appea


dhtmlXTree v2.1 Pro. and dhtmlXMenuObject context menu appears at bottom of containing page



My company has recently purchased a Profession license for DhtmlXTree. I am trying to use the Context Menu within the Tree bu the Menu only appears at the bottom of the page rather than near the tree item that was actually clicked. I have tried the position:relative style change mentioned on this site but without success. Can you tell me how I can correct this behaviour.




My html code is as follows (must work in IE 6 and 7 Browsers) …





 
 
  
 
 

   

  






My JS code is as follows …



function showTree(requiredUrl) {



   var menuUrl = “assessmentPreviewTreeMenu.xml”;
   menu = new dhtmlXMenuObject(null, “standard”);
   menu.setImagePath(“scripts/dhtmlx_v2.1/dhtmlxMenu/codebase/imgs/”);
   menu.setIconsPath(“scripts/dhtmlx_v2.1/dhtmlxMenu/codebase/imgs/”);
   menu.renderAsContextMenu();
   menu.setOpenMode(“web”);
   menu.attachEvent(“onClick”, onMenuItemClick);
   menu.loadXML(menuUrl);




   previewRa_Tree = new dhtmlXTreeObject(“treebox_previewRa_Tree”,“100%”,“100%”,0);
   previewRa_Tree.setImagePath(“scripts/dhtmlx_v2.1/dhtmlxTree/codebase/imgs/”);
   previewRa_Tree.setOnDblClickHandler(doOnDblClick);
   previewRa_Tree.attachEvent(“onXLE”, sortPreviewTree);
   previewRa_Tree.enableCheckBoxes(1);
   previewRa_Tree.enableContextMenu(menu);
   previewRa_Tree.loadXML(requiredUrl);
}




function beforeContextMenuShows(itemId) {
   var id = previewRa_Tree.contextID;
   menu.hideItem(‘edit-issue’);
   menu.hideItem(‘new-issue’ );
   return true;
}



function onMenuItemClick(menuitemId,type){
   var id = previewRa_Tree.contextID;
   alert("You clicked Tree Item id = " + id);
}



Hello,


the issue wasn’t reproduced locally. Could you please provide the complete demo to support@dhtmlx.com


Hi Alex, thanks for coming back so quickly. Thankfully I managed to find the solution after I contacted you yesterday.



I had to change the following line …



menu = new dhtmlXMenuObject(null, “standard”);   … to …
menu = new dhtmlXMenuObject(null, “dhx_blue”);



The Tree context menu is now working as expected. Wonderful product by the way!



Many thanks,



Brian