Tree: Ability to provide extra data per node, and include that data elsewhere #6670
ronnyek
started this conversation in
Feature requests
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I've got the need to render a select tree... where I can check/uncheck items. Later I'd like to get a list of checked items and do things with it.
Currently as long as the data implements at LEAST
TreeNodeData
interface, the tree can render just fine... andgetCheckedNodes
will return the nodes and their select status. The problem seems to be that thegetCheckedNodes
always seems to produceTreeNodeData
, which omits any additional data.I'm not sure if a great implementation would be that TreeNodeData could just have a data property with string/object dictionary or something, and that data would just be included on TreeNodeData, which seemingly would require very little else.
Another option could be to have TreeNodeData have a generic parameter, and the
getCheckedNodes
methods and other methods that return nodes, could be utilized in a generic way such that you always getTreeNodeData<T>
.If there is already a better way to do this, I'd love to know what that should look like. My guesses as to how best to implement this would be based on treeviews I've found in other ui toolkits.
Beta Was this translation helpful? Give feedback.
All reactions