PDA

View Full Version : Select only leaf node in TreeCombo



khebrela
20 Sep 2014, 11:34 AM
Hello,

I need piece of code for my treeCombo for selecting only leaf node.

Thanks.

slemmon
21 Sep 2014, 9:33 PM
You can use the beforeselect event:
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.tree.Panel-event-beforeselect
and return false if the record is not a leaf.

You can use the record's (nodeInterface) isLeaf method:
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.data.NodeInterface-method-isLeaf