Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by lina on Jun 15, 2009 01:17
open dhtmlx forum
url link from dhtmlxWindow

Thanks alex, for the response you sent me,
Hello, 

You can use userdata tag to set url:

...

<item id="1" text="Home" ><userdata name="url">some.com</userdata></item>

...

<script>

menu.attachEvent("onClick",function(id){
var url =  menu.getUserData(id,"url"))

})

</script>

but when i try to implement it i get a blank page..

 

The xml code i put in is below

<item id="m43" text="Stock"><userdata name="url">index2.html</userdata></item>

and the code in my html is;

 

var menu = layoutWin.attachMenu();
   menu.setImagePath("dhtmlxMenu/codebase/imgs/");
  menu.setIconsPath("dhtmlxMenu/images/");
  menu.loadXML("dhtmlxMenu/dhtmlxmenu.xml");
  menu.attachEvent("onClick",function(id){
  var url =  id.getUserData(id,"url"))
  )}

 

Answer posted by Alex (support) on Jun 15, 2009 07:54

Hello Lina,

there is the issue in the onClick event handler that you've set. Please, use the following

menu.attachEvent("onClick",function(id){
  var url = menu.getUserData(id,"url"))
)}

instead of

menu.attachEvent("onClick",function(id){
  var url = id.getUserData(id,"url"))
  )}