Skip to Content
Aug 05, 2021 at 10:40 AM

cl_salv_tree - restoring the tree expansion/collapse status after data change


I have a cl_salv_tree tree. I've various operations on it, like activating a leaf or inserting a new leaf. When I do this, I delete all nodes and rebuild the tree. All works fine, so far as that goes.

However, if I've opened a node, it's now closed again. I'd like to leave it open.

My approach would be to create a class that stores the status of the tree, concerning which nodes are expanded, and then can apply that saved status against the new data held by the tree.

But there seems to be no way to query if a node is expanded or not. I suppose another approach would be to update the tree as the structure changes.

Any ideas for the best way forward.