View Full Version : Disabling Tree nodes

7 Sep 2010, 8:05 AM
Hi All

I have a requirment where i need to show complete tree structures to users but they can only select / highlight a node and its children only.

So lets say

---- Node A
-- Node AA
---- Node B
.... sub tree nodess....
---- Node C
---- NOde CC
---- Node CCC

I want to allow users to be able to only select Node C and its children.. for rest i want to restrict however they can expand it to see it..

please point to a right direction..

7 Sep 2010, 9:04 AM
Write a beforeselect event handler for the treepanel selection model that return false if the node shouldn't be selected.

8 Sep 2010, 12:36 AM

is there any easy way to find parent of a node?

i.e. i would like to check if CCC is a child of C node...

8 Sep 2010, 12:42 AM
A node has a parentNode property, but you could also use the bubble method with a compare function.