Results 1 to 2 of 2

Thread: [2.0] TreePanel expand event is called "expandexpandnode"

  1. #1
    Sencha User
    Join Date
    Mar 2007
    Location
    Austria
    Posts
    118

    Default [2.0] TreePanel expand event is called "expandexpandnode"

    hi,

    just a small thing...
    I want to listen to the node expand event of a TreePanel. "expand" and "expandnode" don't work. Instead I have to listen for "expandexpandnode" - is this intended?

    Example:
    PHP Code:
    Tree Ext.tree;
                  var 
    tree = new Tree.TreePanel("test", {
                    
    animate:true,
                    
    enableDD:true,
                    
    containerScrolltrue,
                    
    rootVisible:false
                
    });
                var 
    root = new Tree.TreeNode({
                    
    text'Albums',
                    
    allowDrag:false,
                    
    allowDrop:false
                
    });
                
    tree.setRootNode(root);

                
    root.appendChild(
                    new 
    Tree.TreeNode({text:'Album 1'cls:'album-node'allowDrag:false}),
                    new 
    Tree.TreeNode({text:'Album 2'cls:'album-node'allowDrag:false}),
                    new 
    Tree.TreeNode({text:'Album 3'cls:'album-node'allowDrag:false})
                );

                
    tree.render();
                
    root.expand();

                
    tree.on('expandexpandnode', function() {
                      
    alert("expandexpandnode fired (1)!");
                  }, 
    tree);


                
    tree.on('expandnode', function() {
                      
    alert("expandnode fired (2)!");
                  }, 
    tree);

                
    tree.on('expand', function() {
                      
    alert("expand fired (3)!");
                  }, 
    tree); 
    results in:
    alert("expandexpandnode fired (1)!");
    Browser: Firefox on Mac,
    Ext 2.0, rev. 702, YUI adapter
    (sorry if this has already been fixed in SVN, I don't update more than once a week).

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    No, this is a silly bug by me, thanks for reporting!

    The culprit, if you just want to edit your file until I check in is in TreePanel.fireEvent:

    ename += ename+'node';

    should be

    ename = ename+'node';

    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •