Menu items not closing on click

Hi,

I have an application where I have created a menu using dhtmlxMenu.
The menu is created using XML and opens in win mode.

The code to load the menu is as follows

[code]

[/code] This code works fine and the menu is populated. The top level menu items have child items. The problem that I am facing is that when I select a child item by clicking on it, the menu does not close like it should. On the other hand if i populate the menu using script, the menu works fine. The XML is generated from the database, and there are no errors in populating the menu. Please help.

Hi
What DHX, browser and OS vwrsion do you have? We can’t reproduce this issue locally.
Could you provide us completed demo to test such behavior?
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Hi Darya,
Thanks for the reply.
I am using the latest version of DHX with IE6 ( company policy) and windows server(R) 2008 OS.
Please find the attached demo.
While creating the demo I noticed that the items that do not have a HREF attribute work correctly while items with HREF attribute give the problem.
In the demo the first child of the first menu item and the first child of the second child item of the first menu item contain href attributes.
complete demo.zip (78.2 KB)

Hi

iframes do not bubble events to parents

you need something like the following

main page:

function hideMenu() { menu.hide(); } var menu = new dhtmlXMenuObject(....); // make sure menu will visible in hideMenu() func menu.attachEvent("onClick", function(){ // init iframe })

iframe:

[code]

.... [/code]

Hi Andrei,
thanks for the reply.
I am sorry I did not understand the second part.
Where do I place the code for the function doOnClick?

Using some hit and trial, I was able to alert a message everytime the mouse comes onto the iframe.
I used the onmouseover event.

But when when I replace the alert statement with menu.hide(), It shows an error
“menu is not defined”.

I placed the function outside the doOnLoad() function.
But if I place the function inside the doOnLoad() function, I am unable to access the hideMenu() function fromt he iframe. :frowning:

removed the menu intialization from the doOnLoad function and it worked. :smiley:

thanks a lot fot your help :slight_smile: