[DHX MENU] add href/url to menu items

Hello!



I’m working with the 2.5 Menu and everything is working fine, except for the case that I can’t add a href/url to a menu item;

I have already read all the topics related to this matter but still no results.

The method that I use for loading the menu is XML which has this form:







http://mywebsite/mypage



http://mywebsite/mypage



http://mywebsite/mypage



http://mywebsite/mypage



http://mywebsite/mypage





And the menu constructor is this:

menu = new dhtmlXMenuObject(“menuObj”, “dhx_black”);

     menu.setIconsPath(“pathtofiles/dhtmlxMenu/codebase/imgs/”);

     menu.attachEvent(“onClick”,function(id){

         var url = menu.getUserData(id,“url”)

         alert(menu.getUserData(id));

         window.location.href=(url);});

     menu.loadXML(“mymenu.xml”);



and the alert message says: null (in other words, the url in the userdata part of the xml is ignored), but the window location does not change.



can you help me please?

there’s a way to put the url without the “http://www” part?

and as a tip, in the product documentation you should put the info for all the forms of construction (for example, the mayority has the script based construction) because I wanted to know if the setHref property applies to the xml version and never find it.



Thanks!


Hello,


userdata tag should be set as a child node of an item tag:





http://mywebsite/mypage


http://mywebsite/mypage


http://mywebsite/mypage


http://mywebsite/mypage


http://mywebsite/mypage