Closed adamdriscoll closed 1 week ago
just in case anyone stumbles on this and is trying to do the same thing - as the code is today in 3.8.9 you can work around this by using the following code in your 'onnodeclicked' for the UDTreeView:
New-UDTreeview -node{[putyourownnodecodehere]} -Id 'treeView' -Expanded:$true -OnNodeClicked{
$ClickedNode = $EventData.ID
Set-UDElement -ID 'treeView' -Properties @{expanded = @($EventData.ID)}
}
Basically you use the onnodeclicked code to force the node that was just clicked to be expanded, which overrides the default behavior which is to toggle the expanded property. As long as your tree isn't really big it shouldn't be too noticable that the tree is actually colapsing and then re-expanding.
Summary of the new feature / enhancement
UDTreeView should have a parameter to prevent it from being collapsed.
Proposed technical implementation details (optional)
No response