PDA

View Full Version : Disabling a node in ExtJs 4.1 Tree Panel



webfriend13
22 Aug 2013, 5:41 AM
HI All,

I have a tree panel which is having multiple nodes. I have a store which contains certain keys. If that key is present in the TreePanel as one of node, I want to disable that node & if possible I want to disable all the descendant nodes for that node.

So it comes down to

1) Disabling a node in TrePanel by ID.
2) Disabling all its child nodes.

How can I implement this.

Thank you

Gary Schlosberg
26 Aug 2013, 3:55 PM
Have you tried disable (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.tree.Panel-method-disable)?
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.tree.Panel-method-disable

aaugen
27 Aug 2013, 12:55 AM
Hi,

What do you mean by disable node? Prevent expend/collapse methods? Prevent click event? Can you explain more what do you want because Ext.data.NodeInterface doesn't have disable property nativly?

Gary Schlosberg
27 Aug 2013, 7:03 AM
Yes, sorry I misread. Disabling tree nodes is not available in 4.x. If you would like to pull this off, it would entail tracking the disabled flag in your data, setting up CSS for a disabled node, setting up a column renderer and and setting up (before) click listeners to disallow functionality for disabled nodes.