0

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 1

1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

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).
Then you can find them all in the store or you ca iterate from the root with cascade method.
I haven't tried cascadeBy but both getData() and eachChild only bring the 'visible' nodes, not the children of collapsed parents.
If cascadeBy doesn't do the job then it's a bug.
Tried cascadeBy starting from the root node and it worked. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.