Results 1 to 3 of 3

Thread: Ext.list.Tree updateOverItem null reference when removing tree node.

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member ebett's Avatar
    Join Date
    Nov 2010
    Location
    Argentina
    Posts
    31

    Exclamation Ext.list.Tree updateOverItem null reference when removing tree node.

    Hi, when I remove a tree node from the tree list:
    Code:
    var parentNode = node.parentNode;
    treeList.setSelection(parentNode.childNodes[0]); //before remove it, select another node (the first)
    parentNode.removeChild(node);
    Afert that, when the mouseover event reacts in the tree list, a null reference error is made in the red line

    Ext.list.Tree:
    Code:
    updateOverItem: function(over, wasOver) {        var map = {},
                state = 2,
                c, node;
            // Walk up the node hierarchy starting at the "over" item and set their "over"
            // config appropriately (2 when over that row, 1 when over a descendant).
            //
            for (c = over; c; c = this.getItem(node.parentNode)) {
                node = c.getNode();
                map[node.internalId] = true;
                c.setOver(state);
                state = 1;
            }
            if (wasOver) {
                // If we wasOver something else previously, walk up that node hierarchy and
                // set their "over" to 0... until we encounter some node that we are still
                // "over" (as determined in previous loop).
                //
                for (c = wasOver; c; c = this.getItem(node.parentNode)) {
                    node = c.getNode();
                    if (map[node.internalId]) {  // node is null when I remove the tree node
                        break;
                    }
                    c.setOver(0);
                }
            }
        },

  2. #2
    Sencha Premium Member ebett's Avatar
    Join Date
    Nov 2010
    Location
    Argentina
    Posts
    31

    Default

    My solution was override the method

    Code:
    if (!node || map[node.internalId]) { 
                        break;
                    }

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report and for posting your solution. Are you able to recreate this issue in a test case?
    https://fiddle.sencha.com/#view/editor

Similar Threads

  1. (Amazing :)) issue on tree Removing a node on a tree
    By raphael.franchet in forum Ext JS 6.x Bugs
    Replies: 1
    Last Post: 30 Jun 2015, 11:33 AM
  2. Removing the checked box in a tree node
    By pablodcar in forum Ext: Discussion
    Replies: 2
    Last Post: 9 Jun 2011, 7:12 AM
  3. Copy a node from one tree to the other without removing it from the original
    By ahmadfareed in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 11 Feb 2010, 7:01 AM
  4. Problem in removing a node from tree:deletin alternate node
    By varsha.kothari in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 14 Apr 2009, 1:13 AM
  5. Help removing a node from a tree
    By bsklar_ca in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 10 Feb 2009, 12:57 PM

Tags for this Thread

Posting Permissions

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