I'm looking for a way to get all loaded nodes from a tree store, even those whose parents are COLLAPSED. Right now the store contains only the "visible" records, i.e. all the nodes that are either expanded or leaf nodes. Is there a way to get all the loaded nodes (even leaf nodes whose parents are collapsed)? It seems there is no method that returns such an array.
1 Answer
That is the default behavior of an asynchronous tree: it only loads children when user expands the parent. You must send the complete tree from the server to access all nodes through the tree store.
5 Comments
PentaKon
The children are actually loaded but the parent is collapsed. Scenario: I have a parent node called parent1. I expand it. The server brings the child nodes etc. I edit some of the child nodes since they are checkbox nodes. Then I collapse parent1 and move on to parent2 etc. After I've edited all the leaf nodes needed, I want to be able to access all previously loaded but now collapsed parent nodes and their children. They are not lost since when I re-expand the parent there is no server call and the leaf node state remains the same (i.e. they are checked or unchecked).
Saki
Then you can find them all in the store or you ca iterate from the root with
cascade method.PentaKon
I haven't tried
cascadeBy but both getData() and eachChild only bring the 'visible' nodes, not the children of collapsed parents.Saki
If cascadeBy doesn't do the job then it's a bug.
PentaKon
Tried
cascadeBy starting from the root node and it worked. Thanks!