1. #1
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    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 Removing a TreeNode success but with error

    Removing a TreeNode success but with error


    I'm trying to remove a node and it does remove it but I get this error:

    TypeError: Result of expression 'b.ui' [null] is not an object.
    I append nodes using this:

    Code:
    node.appendChild({
    	nodeType: "node",
    	text: name,
    	location: location
    });
    Now I can do a try catch to get rid of the error popping up but that kind of defeats the purpose.
    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.

  2. #2
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    I only find "b.ui" in ext-all.js. Please use ext-all-debug.js since I don't feel like searching the right method in ext-all.js
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    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


    Ok so now I get these errors:

    TypeError: Result of expression 'node.ui' [null] is not an object.

    at app:/extjs/ext-all-debug.js : 49154

    at app:/extjs/ext-all-debug.js : 48663

    at app:/main.js : 57

    at app:/extjs/ext-all-debug.js : 2250

    at app:/extjs/ext-all-debug.js : 1920

    at app:/extjs/ext-all-debug.js : 54106

    at app:/extjs/ext-all-debug.js : 53368

    h at app:/extjs/ext-all-debug.js : 2646

    undefined at undefined : undefined
    Line 49154 is this:
    Code:
        removeChild : function(node, destroy){
            this.ownerTree.getSelectionModel().unselect(node);
            Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments);
            // if it's been rendered remove dom node
            if(node.ui.rendered){
                node.ui.remove();
            }
            if(this.childNodes.length < 1){
                this.collapse(false, false);
            }else{
                this.ui.updateExpandIcon();
            }
            if(!this.firstChild && !this.isHiddenRoot()) {
                this.childrenRendered = false;
            }
            return node;
        },
    Line 48663 is this:
    Code:
        remove : function(destroy){
            this.parentNode.removeChild(this, destroy);
            return this;
        },
    The rest are cleaning up the events. When I tried doing node.ui.rendered it returned true. When I tried doing node.ui.remove() it removed the dom with no errors so I'm not sure why it's doing this.
    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.

  4. #4
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    I did a node.appendChild like you've mentioned in the first post. I didn't get any errors.
    Do you have overrides/extends on TreeNodes? I think it would be helpful, if you provide some more code that can reproduce your issue (look around main.js line 57 ).
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

Thread Participants: 1