Menu, complex item onlick event

Hi, I have attached the onlick event like this

menu.attachEvent("onClick", function (id, zoneId, casState) { window.location = id; });

but the event isn’t raised when I click on a complex type. Is there any way to activate the onlick event for complex items ?

Hi,

you need to modify the dhtmlxmenu.js. Locate and comment the following line:

// if (type.charAt(0)==“c”) return;

The line // if (type.charAt(0)==“c”) return; isn’t anymore in the 3.0 version of the menu component.

How can I enable the onclick event on a complex type ?

Please search the line:

if (type.charAt(0)==“c”) return;

in dhtmlxMenu/sources/dhtmlxmenu.js

dhtmlxMenu/codebase/dhtmlxmenu.js is minified and the search line will be different there.

Problem solved :exclamation: thx

hi
im facing similar issue as above …
when i search for the line in .js file i have not found…
if (type.charAt(0)==“c”) return;

pls tell me what is the line to search/modify in dhtmlxMenu/codebase/dhtmlxmenu.js … as im using 3.0 version…

pls help its urgent …

Hi,

“codebase” contains compressed libs. Try to search in dhtmlxMenu/sources/dhtmlxmenu.js. You will also need to include library from sources folder in your app.

If you want to use codebase/dhtmlxmenu.js, you can attach it - we will try find and remove the necessary code snippet there.

Hi …
Sorry that i dont even find <dhtmlxMenu/sources/dhtmlxmenu.js> in our app. I might required to add this file by downloading externally, they are already added required library files earlier, so cant modify the software lib in app :frowning:

Hi

I have added --<sources/dhtmlxmenu.js> and as per that its working fine after commenting the line.
thaks for that. But event is working for only top-level menu’s or complex menus :frowning:
cant i enable to work the same to fire the event even when sub menus are clicked … ??
thanks …

Could you attach the demo that reproduces the problem ?