This duplicates another bug already reported in our system: EXTJS-6314
  1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    102
    Vote Rating
    6
    campersau1 is on a distinguished road

      1  

    Default Ext 4.1.1 RC1 tree node deep copy is not deep

    Ext 4.1.1 RC1 tree node deep copy is not deep


    The NodeInterface.copy method doesn't copy the childnodes which are deeper than level 1.

    Here is the fix:

    NodeInterface.js
    Code:
                    copy: function(newId, deep) {
                        var me = this,
                            //result = me.callOverridden(arguments),
                            result = me.createNode(me.callOverridden(arguments)),
                            len = me.childNodes ? me.childNodes.length : 0,
                            i;
    
    
                        // Move child nodes across to the copy if required
                        if (deep) {
                            for (i = 0; i < len; i++) {
    //                            result.appendChild(me.childNodes[i].copy(true));
                                result.appendChild(me.childNodes[i].copy(newId, deep));
                            }
                        }
                        return result;
                    },
    This bug was metioned before here:
    http://www.sencha.com/forum/showthre...ight=node+copy

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,541
    Vote Rating
    872
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2009
    Posts
    102
    Vote Rating
    6
    campersau1 is on a distinguished road

      0  

    Default


    any news on this?

    it is really annoying to change that code in every release.

  4. #4
    Ext JS Premium Member cdomigan's Avatar
    Join Date
    Mar 2007
    Posts
    148
    Vote Rating
    1
    cdomigan is on a distinguished road

      0  

    Default


    Note that this method also has to be changed in NodeInterface.getPrototypeBody() if you are going to be decorating models as Nodes!

Thread Participants: 2

Tags for this Thread