Вы можете определить свое дерево как:
var myTree = new Ext.tree.TreePanel({
region: 'west',
id: 'navTree',
title: 'Items',
width: 200,
store: store,
split: true,
collapsible: true,
listeners: {
itemclick: {
fn: function (view, record, item, index, event) {
//the record is the data node that was clicked
//the item is the html dom element in the tree that was clicked
//index is the index of the node relative to its parent
nodeId = record.data.id;
htmlId = item.id;
if (record.data.leaf) {
Ext.Msg.alert("Alert", "leaf");
}
else {
Ext.Msg.alert("Alert", "Not leaf");
}
}
}
}
})