Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: tree node copy(deep) not working (4.0.1)

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    229

    Default tree node copy(deep) not working (4.0.1)

    This has already been reported here and here, but not yet taken into account, I suppose.
    This is what makes my code work again (ext-all-debug, line 51399)
    Cheers
    C.

    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;
    
                        
                        if (deep) {
                            for (i = 0; i < len; i++) {
                           //     result.appendChild(me.childNodes[i].copy(true));
                                result.appendChild(me.childNodes[i].copy(null, true));
                           
                            }
                        }
                        return result;
                    },

  2. #2
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    229

    Default

    This is still a bug in 4.0.2.

  3. #3
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    229

    Default

    bump - still there in 4.0.2a

  4. #4
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    229

    Default

    bump - any news ?
    C.

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2009
    Posts
    92

    Default Bug Report

    Thanks @christophe.geiser for the info on how to fix this!


    I've put together a bug report so maybe someone will actually take some notice!



    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.0.2a


    Description:
    • The Node Interface has a copy method that errors when performing a deep copy


    Steps to reproduce the problem:
    • Create a node that has child nodes
    • Try and do a deep copy


    HELPFUL INFORMATION

    Possible fix:
    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(null, true));
    		}
    	}
    	return result;
    },

  6. #6
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    229

    Default

    Thanks,
    I like the formulation 'maybe someone [somehow, somewhere] will actually take some notice'
    Cheers,
    C.

  7. #7
    Sencha Premium Member
    Join Date
    Nov 2009
    Posts
    92

    Default

    LOL,

    How about I add a little more code...


    Code:
    var takeSomeNotice = (someone || somehow || somewhere);
    
    if (takeSomeNotice) {
            developer = 'Run around, jumping for joy';
    }

  8. #8
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    229

    Default

    Bump - would be interested to know if this has been fixed.
    Cheers
    C.

  9. #9
    Sencha User
    Join Date
    Nov 2008
    Location
    Lyon, France
    Posts
    229

    Default

    Still there in 4.0.7

  10. #10

    Default

    bump

Page 1 of 2 12 LastLast

Posting Permissions

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