Results 1 to 2 of 2

Thread: [FIXED-1030] Unable to delete tree node when it hasn't been rendered yet

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    May 2007
    Aalborg, Denmark

    Default [FIXED-1030] Unable to delete tree node when it hasn't been rendered yet

    Ext version tested:
    • Ext 3.2.1

    Adapter used:
    • ext

    css used:
    • only default ext-all.css

    Browser versions tested against:
    • FF3.6.4 (firebug 1.5.4 installed)

    Operating System:
    • WinXP Pro

    When trying to delete the last child of a tree node which hasn't been rendered yet, you get an error saying "this.ctNode is undefined". This is because the parent node is collapsed with no regard to whether it has been rendered or not.

    Test Case:

    var r = new Ext.tree.TreeNode({
        text: 'root',
        expanded: true,
        leaf: false
    var n1 = new Ext.tree.TreeNode({
        text: 'node1',
        expanded: true,
        leaf: false
    var w = new Ext.Window({
        layout: 'fit',
        title: 'Tree window',
        width: 200,
        height: 200,
        items: [
            xtype: 'treepanel',
            title: 'Tree Panel',
            root: r
    Steps to reproduce the problem:
    • Just run the code above in a page which has Ext 3.2.1 loaded. It will give the described error. Try removing the comment from the line and run it again. The error is gone and a window with a tree panel and a single node 'root' is visible.

    Possible fix:
    This override fixes the problem but I'm not sure it is the right place to fix it. My changes in red.
    Ext.override(Ext.tree.TreeNode, {
       // private override
       removeChild: function(node, destroy)
          Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments);
          // only update the ui if we're not destroying
          if (!destroy)
             // if it's been rendered remove dom node
             if (node.ui.rendered)
             if (this.childNodes.length < 1)
                if (node.ui.rendered)
                   this.collapse(false, false);
             } else
             if (!this.firstChild && !this.isHiddenRoot())
                this.childrenRendered = false;
          return node;

  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Sydney, Australia


    Thanks for the report, it's been corrected in SVN for 3.3.

Similar Threads

  1. Tree node and delete entry
    By pactgmbh in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 24 Jan 2011, 9:20 PM
  2. Replies: 1
    Last Post: 20 May 2010, 9:06 AM
  3. Tree Node 'rendered' event
    By ewg in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 3 Feb 2009, 6:12 AM
  4. right-click delete node from tree?
    By vn_beth in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 24 Apr 2008, 11:44 AM
  5. Replies: 3
    Last Post: 11 Oct 2007, 9:33 PM

Posting Permissions

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