Open stsrki opened 4 years ago
It would be nice to have a way to customise the icons for opening and closing a node. For example, I would like to replace the plus and minus icons for a right and down arrow.
@stsrki Not sure if it's the right place to ask/suggest.
It's rather hard to expand and collapse TreeView
nodes on mobile phone. It works 50/50, I'd say.
Maybe the suggested above custom (larger) icons may help, if implemented.
I just tested on mobile. You're right, something is wrong with click or tap events. I need to "click" several times to make it expand or collapse. Weird...
If this needs a separate issue please let me know.
No need, I have updated the original ticket with new item.
One more minor defect (?) - on hovering over expand/collapse icons the mouse pointer does not change from the "arrow" to "hand" (click me convention).
Is there a way to expand all Nodes by default on page load?
To expand all nodes I would loop through and add all nodes to an IList
<TreeView Nodes="holdings"
@bind-SelectedNode="selectedNode"
@bind-ExpandedNodes="expandedNodes"
GetChildNodes="@(item => item.Children)"
HasChildNodes="@(item => item.Children?.Any() == true)">
<NodeContent>
@if (context.HoldingType == "Holding Unit")
{
<Icon Name="IconName.Building" />
}
else if (context.HoldingType == "Room")
{
<Icon Name="@("fa-door-closed")" />
}
else if (context.HoldingType == "Cage")
{
<Icon Name="@("fa-th")" />
}
@context.Text
</NodeContent>
</TreeView>
It would be nice to have a way to customise the icons for opening and closing a node. For example, I would like to replace the plus and minus icons for a right and down arrow.
Any progress on this?
I would like to at least vertically align the +
and -
icons when using a custom razor component for the tree node.
We don't have any milestones still. But, PRs are welcome :)
I added customizable icon for collapse/ expand icon. pull request
Features for next version of TreeView
@robalexclark