tags:

views:

70

answers:

2
myTree.on('click',function(node){
                 if(node.isLeaf())
                  {
                    Ext.Msg.alert("You are in value ",nodeValue,"whose name is",nodeName);
                    alert("You are in value ",nodeValue,"whose name is",nodeName);
                  }
             });

myTree is a TreePanel. I'm getting a tree but click function is not working. I'm very new to extjs. Help me out.

Thanks in advance

A: 

Looks like you are looking for:

node.value
node.name

OR (I'm not good with Ext)

node.nodeValue
node.nodeName
Simeon
+1  A: 

Try this instead:

myTree.on('click',function(node){
    if(node.isLeaf())
    {
        Ext.MessageBox.show({
            msg: 'You are in text ' + node.text + ', whose id is ' + node.id,
            buttons: Ext.MessageBox.OK,
            icon: Ext.MessageBox.INFO
        });
    }
});

Haven't tried it, but it looks very similar to what I have been working with today :)

Chau