Can I fetch a list of all childless descendants of a given tree item? #233
Unanswered
alexdarling
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I'm trying to create a tree with indeterminate checks based on whether a descendent is checked, like in this CSS Tricks tutorial. This may be an X/Y problem so I'll describe my thought process. I'm looking at a 2-part logic that keys off of which tree items are selected:
Here's some rough code I put together for this calculation:
I can derive
selectedItems
with something like this:What I'm stuck on now is determining all the descendants of a given tree item. All I need is a list of
TreeItemIndex
and I can feed them into myselectedItems
, but I'm not sure how to fetch descendant information. Is there an API for this, or a way to query a tree ref by tree item index?Beta Was this translation helpful? Give feedback.
All reactions