Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    26
    Vote Rating
    0
    jtvoorde is on a distinguished road

      0  

    Default [CLOSED] Ext 3.1.2 (rev 6140) Error in AsyncTreeNode.reload

    [CLOSED] Ext 3.1.2 (rev 6140) Error in AsyncTreeNode.reload


    Hi,

    Since the latest change in Ext.data.Node I get an error in Node.remove when calling AsyncTreeNode.reload()

    The error is:

    this.parentNode is null
    [Break on this error] this.parentNode.removeChild(this, destroy);

    Which is in data/Tree.js

    When i revert data/Tree.js to rev 6056 the problem is resolved.

    The stack is (sorry for the layout):

    AsyncTreeNode:

    Code:
    /**
    50443 * Trigger a reload for this node
    50444 * @param {Function} callback
    50445 * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this Node.
    50446 */
    50447 reload : function(callback, scope){
    50448 this.collapse(false, false);
    50449 while(this.firstChild){
    50450 this.removeChild(this.firstChild).destroy();
    50451 }
    50452 this.childrenRendered = false;
    50453 this.loaded = false;
    50454 if(this.isHiddenRoot()){
    50455 this.expanded = false;
    50456 }
    50457 this.expand(false, false, callback, scope);
    50458 }
    50459}); 
    
    
     //inherit docs
    50339 destroy : function(silent){
    50340 if(silent === true){
    50341 this.unselect(true);
    50342 }
    50343 Ext.tree.TreeNode.superclass.destroy.call(this, silent);
    50344 Ext.destroy(this.ui, this.loader);
    50345 this.ui = this.loader = null;
    50346 },
    From here in Tree.js:

    Code:
     destroy : function(/* private */ silent){
    49443 /*
    49444 * Silent is to be used in a number of cases
    49445 * 1) When setRootNode is called.
    49446 * 2) When destroy on the tree is called
    49447 * 3) For destroying child nodes on a node
    49448 */
    49449 if(silent === true){
    49450 this.purgeListeners();
    49451 this.clear(true);
    49452 Ext.each(this.childNodes, function(n){
    49453 n.destroy(true);
    49454 });
    49455 this.childNodes = null;
    49456 }else{
    49457 this.remove(true);
    49458 }
    49459 }, 
    
     /**
    49518 * Removes this node from its parent
    49519 * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.
    49520 * @return {Node} this
    49521 */
    49522 remove : function(destroy){
    49523 this.parentNode.removeChild(this, destroy);
    49524 return this;
    49525 },

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,647
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Fairly sure this is already fixed. Can you grab the latest?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    26
    Vote Rating
    0
    jtvoorde is on a distinguished road

      0  

    Default


    I am using the latest (from branch 3.1.x).

    I delved in a bit further and I think this is the problem:

    in reload the removeChild function calls .clear() on the node is returns.
    Then .destroy() is called on that node which calls remove where the error is thrown because parentNode is already set to null by the first call to .clear()

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,647
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    As I said, I think it's fixed in the 3.2.x branch.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    26
    Vote Rating
    0
    jtvoorde is on a distinguished road

      0  

    Default


    I just compared AsyncTreeNode.js and Tree.js and they are the same in both branches.
    I am checking out 3.2.x now and will try again but, if it is fixed, will this this be backported to 3.1.x?

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,647
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    26
    Vote Rating
    0
    jtvoorde is on a distinguished road

      0  

    Default


    Sorry about that. Is is indeed fixed in 3.2.x. Will this also be applied to 3.1.3?

Thread Participants: 1