I need to show a list of active items. Every item has more than one parent. I want to group them by parents with a treeview, but I have this situation:

- Parent A
  - Child A
  - Child B
- Parent B
  - Child B
  - Child C

How can I group items by parent without have this scenario? I think that treeview isn't the best choice for that, but I don't know a better solution.

  • What are you trying to achieve? A treeview is a parent child relationship (one to many) – DarrylGodden Jul 8 '19 at 13:54
  • @DarrylGodden I want to show a list of items and associate with their parents, also by color or other. When user select an item, he can know which parents have that item. – Unicorn365 Jul 8 '19 at 14:06
  • @Unicorn365 Are you trying to show this on a website, or on a chart/image, what is the goal of displaying these items? – DasBeasto Jul 8 '19 at 14:35
  • @DasBeasto Hi, I try to show on a web application – Unicorn365 Jul 8 '19 at 15:07
  • @Unicorn365 Can users select either Children or Parents? Would they have a reason to look from both perspectives? – Mike M Jul 8 '19 at 15:34

A hierarchy relationship is more related to what you are trying to achieve. Without any further information.


  • How can I represent this structure? Which is the best component to show something similar? – Unicorn365 Jul 8 '19 at 14:10
  • Because of its nested nature, HTML does not have a native structure which neatly captures this kind of relationship (elements can only have a single parent). Instead, you'll need to use elements for nodes, and separate elements for connections between them. I have done a similar thing by loading my nodes, specifying the parent(s) and child(ren) nodes in data attributes, and then using javascript to draw SVG connections between them. That sort of code is probably out of scope for UX, and better suited to stackoverflow.com – Beejamin Jul 8 '19 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.