Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by skm on Jul 21, 2009 10:19
open dhtmlx forum
Click action enable/disable for some nodes in Tree

Hello Support,

I have the following code for Tree nodes to display a url.

function doOnClick(id){
 var myUrl = tree.getUserData(id,"href");
 if (myUrl)
    parent.right.location.href = myUrl;

How do I enable or disable the click itself. Is there a way to do that? - to be more elaborate I dont want to see the "hand" icon for some nodes (non-clickable) in the Tree.

Thanks,

skm

Answer posted by Alex (support) on Jul 22, 2009 02:46

Hello, 

>> How do I enable or disable the click itself. Is there a way to do that?

it isn't possible. You can use onClick event handler to call functions only for a certain nodes. 

>>  I dont want to see the "hand" icon for some nodes (non-clickable) in the Tree

in order to change the cursor to default for some nodes you should sue the following approach:

tree.attachEvent("onMouseIn",function(id){
  if(!tree._idpull[id]) return
  
  var target = tree._idpull[id].htmlNode.firstChild.firstChild.childNodes[3];
  
  if(....) target.style.cursor="default";
})