Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by arch on Jun 15, 2009 06:17
open dhtmlx forum
DHTMLXMenu ToolTip

I am constructing a dhtmlxmenu object and populating it completely thro script. How do I achieve the following ?

1. Changing the image on mouse hover for the main menu item (sibling)?
2.How do i set a tool tip for only the main menu item(not the child items)?
Answer posted by Alex (support) on Jun 15, 2009 08:16

Hello,

You can try to change image as follows

menu.attachEvent("onTouch",function(id){

  window.setTimeout(function(){menu.setItemImage(id,"new.gif")},1)
})

tooltips can be defined in the xml using the following method:

<item id="some id" text="some text"><tooltip>some tooltip</tooltip>

Answer posted on Jun 18, 2009 03:02
I am not populating the menu using xml... doing it thro script ..
var menu = new dhtmlXMenuObject('xyz','clear_silver');   
            menu.imgURL = "<%=appName%>/tpc/dhtmlx/dhtmlxMenu/codebase/imgs/";
            menu.setImagePath("<%=appName%>/tpc/dhtmlx/dhtmlxMenu/codebase/imgs/");
            menu.setIconsPath("<%=appName%>/images/");
         menu.setOpenMode("win");                                           
        menu.addNewSibling(null, "file", "", false,"timeicon.gif");
menu.setTooltip("file","Tooltip!");

does not display the tooltip.
however alert(menu.getTooltip("file")) returns the correct tooltip. The display is missing
Answer posted by Alex (support) on Jun 18, 2009 03:37

Hello,

the issue wasn't reproduced locally. Please, try to use the latest menu version (attached file).

If the problem still occurs, please provide the sample where we can re-create it. 

Answer posted on Jun 18, 2009 03:47
Can you please attach the file ?
Answer posted by Alex (support) on Jun 18, 2009 04:37
Sorry, the file is attached
Attachments (1)
Answer posted on Jun 18, 2009 05:26
Replaced it with the attached file. Now the menu creation itself is throwing a js error- object expected :

var menu = new dhtmlXMenuObject("divid","clear_silver");

divid is the id of teh container div ! what could be the problem ?
Answer posted by Alex (support) on Jun 18, 2009 06:10

The possible reason for the problem is using some old version of the dhtmlxcommon.js (the latest 2.1 is attached).

Attachments (1)