-
5 Dec 2012 5:32 AM #1
[4.1.3] Tree node removeAll(true) throws exception when there's a child node.
[4.1.3] Tree node removeAll(true) throws exception when there's a child node.
TypeError: 'undefined' is not a function (evaluating 'store.remove(me, true)')
Code:var store = new Ext.data.TreeStore({ fields: [{ name: 'text' }] }); var tree = new Ext.tree.TreePanel({ store: store, rootVisible: false, title: 'Remove all', renderTo: Ext.getBody(), width: 200, height: 200, x: 10, y: 10, tbar: { items: [{ text: 'Remove All', handler: function() { store.getRootNode().removeAll(true); } }] } }); var node = store.getRootNode().appendChild({ text: 'foo', id: 1235, expandable: true, leaf: false }); node.appendChild({ text: 'bar', id: 6789, expandable: false, leaf: true });
-
5 Dec 2012 11:54 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Thanks for the report! I have opened a bug in our bug tracker.
-
21 Jan 2013 2:34 PM #3
Hi everybody,
I'm also getting some problems when trying to call node.remove(true). When node doesn't have any leafs everything's fine. If there are child nodes - I'm getting following error:
Uncaught TypeError: Object [object Object] has no method 'remove'
It seems that while deleting each child node the reference to the store to wich this node belongs is not empty:
- store: constructor
- stores: Array[1]
That's why there is an attemt to call remove function from the store containing node:
store.remove(me, true);
And, according the documentation there is no remove method in Ext.data.TreeStore class.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-7916
in
4.2.0.265.


Reply With Quote