I’m using an STreeView and when I try to expand a node with children NOT on the root level it doesn’t work and won’t expand, neither with double-clicking nor using an SExpanderArrow.
The nodes contain valid children ( OnGetChildren returns the children and SExpanderArrow is visible).
I tried binding OnMouseDoubleClick event and call SetItemExpansion manually, but it doesn’t work either. However when using this event, IsItemExpanded returns true right after calling SetItemExpansion.
To create custom TreeRows and TreeNodes I used the SceneOutliner as a reference, and I don’t understand what I’m doing differently from it (I’m using STreeView as it is, I’m not inheriting from it, though).
I fixed this bug, which I had forgotten for a while:
Don’t dynamically create an array of children in the OnGetChildren method. Store the children nodes in a member variable and return it; OnGetChildren is just a getter.
Hey, you probably dont even remember becuase it was like 4 years ago, But do you think you can help me?
Im getting the same issues and I dont really understand what you mean by returnning the member variable
I had the same thing happen as OP. What I did is in my FItemInfo I added a member variable like this:
class FItemInfo
{
TArray<TSharedPtr<FItemInfo>> Children;
};
, then OnGetChildren, I populate that array and also output the elements from it into the out array reference. Before I was only outputting the elements without keeping my own shared ptr of the children.