Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 07, 2007 10:51
open dhtmlx forum
you give an example of an event handler in order when you click on a node to go to a link  tr...

you give an example of an event handler in order when you click on a node to go to a link

 
tree.setOnClickHandler(doOnClick);

function doOnClick(nodeId){

var myUrl = tree.getUserData(nodeId,'myurl'); window.open(myUrl);

// or frames["someframe"].location.href = myUrl

 }
 

with the window.open   if opens a new window.

i can not find how to change it to open the link in the same window. since I just want to navigate in my site through url (i am using variables in the url and need to encode first in the xml file)

do we have to use this event handler when we navigate on the same site, or is there another handler to call pages from the same domain?
Answer posted on Mar 07, 2007 10:51

You can use document.location to change location of current document.

function doOnClick(nodeId){

                var myUrl = tree.getUserData(nodeId,'myurl');

                document.location.href=myUrl;

}
Answer posted by Andrei (Support) on Dec 05, 2014 19:35

Not much can be said in addition to the reply above, but you also can check datagrid controls and javascript select combobox and find out what we have probably missed in our explanation.