0

does anyone know a way to find out, in ExtJS if a selected item in an Ext.tree.Panel has a child? I know you can find a selected item by doing tree_dir.getSelectionModel().getSelection() but I don't see any way to check if it has any children.

Art F
  • 3,992
  • 10
  • 49
  • 81

1 Answers1

1

The instance returned by tree_dir.getSelectionModel().getSelection() should have hasChildNodes() method specifically for that purpose.

bjornd
  • 22,397
  • 4
  • 57
  • 73
  • 1
    To extend on this answer. A tree node is wrapped with [Ext.data.NodeInterface](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.NodeInterface-method-hasChildNodes), which is where you will find `hasChildNodes()`. – Izhaki Nov 28 '12 at 15:44