Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by zoomsthru on Jul 15, 2009 07:11
open dhtmlx forum
dhtmlx context menu does not show in IE7

I can see a very small part of a context menu when I right-click on a tree, but that's it - I can't see any of the text or icons. Can you point out what I'm missing? This is my code:

<script language="JavaScript" src="dhtmlx/dhtmlXProtobar.js"></script>
<script language="JavaScript" src="dhtmlx/dhtmlXMenuBar.js"></script>
<script language="JavaScript" src="dhtmlx/dhtmlXMenuBar_cp.js"></script>
<link rel="STYLESHEET" type="text/css" href="dhtmlx/dhtmlx.css">
<link rel="STYLESHEET" type="text/css" href="dhtmlx/context.css">
<link rel="STYLESHEET" type="text/css" href="dhtmlx/dhtmlxmenu.css">

<script>
function doOnLoad(){
.
.
myMenu = new dhtmlXContextMenuObject('120',0,"Demo Menu");
myMenu.menu.setGfxPath("dhtmlx/imgs/");
myMenu.menu.loadXML("dhtmlx/_context.xml");
myMenu.setContextMenuHandler(onButtonClick);
.
.
myTree.enableContextMenu(myMenu);

</script>
<body onload="doOnLoad()"....>
Answer posted by Alex (support) on Jul 15, 2009 07:49

Hello, 

what menu version do you use ? the code, that you've provided, corresponds to menu 1.0 (the previous version). The latest version has different API and libraries. The samples can be found in the tree package: dhtmlxTree/samples/context_menu/

If using menu 1.0 is premeditated, please provide the sample to recreate the issue as the code looks correct.

 

Answer posted by zoomsthru on Jul 16, 2009 09:10
Thanks for the prompt reply, Alex. I got it working by looking at the examples, and I didn't need the javascript sources I had previously included. This is the change I made to get it working.


<link rel="STYLESHEET" type="text/css" href="dhtmlx/dhtmlx.css">
    <link rel="STYLESHEET" type="text/css" href="dhtmlx/context.css">
    <link rel="STYLESHEET" type="text/css" href="dhtmlx/dhtmlxMenu.css">
.
.
myMenu = new dhtmlXMenuObject(null);
        myMenu.setImagePath("dhtmlx/imgs/");
        myMenu.setIconsPath("dhtmlx/imgs/");
        myMenu.renderAsContextMenu();
        myMenu.setOpenMode("web");
        myMenu.attachEvent("onClick", treeMenuClick);
        myMenu.loadXML("dhtmlx/_context.xml");
.
.
myTree.enableContextMenu(myMenu);