-
15 Apr 2010 4:55 PM #1Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
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:
I append nodes using this:TypeError: Result of expression 'b.ui' [null] is not an object.
Now I can do a try catch to get rid of the error popping up but that kind of defeats the purpose.Code:node.appendChild({ nodeType: "node", text: name, location: location });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
15 Apr 2010 9:05 PM #2
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
-
16 Apr 2010 5:24 AM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Ok so now I get these errors:
Line 49154 is this: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 48663 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; },
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.Code:remove : function(destroy){ this.parentNode.removeChild(this, destroy); return this; },Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Apr 2010 6:15 AM #4
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


Reply With Quote