How to delete a node off the tree?
This shouldn't be that hard, should it? I need to search through the store to find nodes that meet a certain criteria, and simply delete them (be they leaves or branches)?
Here's what I've got:
Code:
var store = tree.getStore();store.doOnLoad(function(store) {
var root = Ext.valueFrom(null, tree.getRootNode());
root.cascadeBy(function(node) {
if (node.get("archived") == true) {
store.getById(node.internalId).remove();
}
});
});
It's throwing a "childNodes[i] is undefined" error: childNodes[i].cascadeBy(fn, scope, args); [ext-all-dev.js (line 56625)]
Since it's throwing that inside a recursion loop, it would seem to indicate that it doesn't know to not follow that branch when its ancestor has been deleted. But that's only a guess at this point.
Been beating my head against the wall for far too long on this one. Any help would be greatly appreciated.