This is a little "diagram":
If you need the leaf from beginning with:
one node selected:
var nodeData = treePanel.getSelectionModel().getSelection();
from the begin:
var node = treePanel.getRootNode(); -- father ( first Node );
findLeaf : function(node){
if(node.isLeaf()){ // this is the node that u want }else{ // bucle to find it node.eachChild(function(nodeChild,array){ if(nodeChild.isLeaf()){ // this is the node that u want }else{ // get childs of this node if(nodeChild.hasChildNodes()){ //find the childs from this node. this.findLeaf(nodeChild); } } }); }
};