Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Stelios on Apr 16, 2009 04:13
open dhtmlx forum
Tree unclosable node

How can i make a node in the tree unclosable? I don't want the user to be able to close the parent node of my tree , is this possible?

Thanks in advance
Answer posted by Alex (support) on Apr 16, 2009 05:18

You can use event handlers to prevent item closing:

tree.attachEvent("onOpenStart",function(id,state){
  if(id==locked_id && state==1) return false
  return true
})
tree.attachEvent("onDblClick",function(id){
  if(id==locked_id) return false
  return true
})


Where locked_id is the id of the item that be always opened.