Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type INode should have an additional property to store meta data. #86

Closed
owaisahmad-dev opened this issue Feb 22, 2023 · 5 comments · Fixed by #117
Closed

Type INode should have an additional property to store meta data. #86

owaisahmad-dev opened this issue Feb 22, 2023 · 5 comments · Fixed by #117

Comments

@owaisahmad-dev
Copy link

Describe the solution you'd like
I want to pass some metadata to each node whilst creating the checkbox tree data.

type INode<T> = INode & {
    metadata: T
}

What value does this proposed solution bring to users?
The users will then be able to customize the outlook of each node, for example, if they want to add a number of children alongside the name they can pass that information to the parent nodes' metadata. Another example would be to be able to add tags, which can show as span elements alongside the element's name.

Describe alternatives you've considered
The alternative currently is to pass all this information somehow inside the name string and then parse that information in the nodeRenderer method. But that seems sub-optimal.

@dgreene1
Copy link
Owner

PRs are welcome if you would like to submit the solution. Ofherwise the current solution exists and is described in #82 (comment) and #70

@owaisahmad-dev
Copy link
Author

I will work on it this weekend and create a PR then. It would be a valuable modification.

@stale
Copy link

stale bot commented Apr 29, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 29, 2023
@stale
Copy link

stale bot commented May 6, 2023

This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions.

@dgreene1
Copy link
Owner

dgreene1 commented Jun 8, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants