Dropdown for Tables of Children in Tree-App

Description of the limitation and why it is relevant to address

As a Developer/User, I want to quickly switch between different child tables using a dropdown menu, so that I can navigate the UI more efficiently and easily access the tables I need.

I think this is relevant for the VIKTOR platform because this would enhance the user experience by replacing horizontal scrolling with a more intuitive dropdown. This change can reduce clutter and streamline navigation by providing a smoother workflow.

Submitter proposed design (optional)

Instead of the current scrolling mechanism:

Users would be presented with a dropdown listing all available child entities, allowing them to select a table from that list. Thus, this would make show_children_as = 'Table' a much more attractive option for large sets of EntityType (think 10+ or 20+ EntityTypes, and lists with 20+ to 100+ entities).

Current workarounds

The available choices as of now are in the documentation:
image

Hi @kassi,

I think you can solve your problem by using the ChildEntityManager: Layout & styling - Navigation inside a workspace | VIKTOR Documentation

You can achieve this by:

  1. Adding an editor to the parent entity (project)
  2. In this editor, add an optionfield with a list of all the entity types
  3. Add a ChildEntityManager for each entity type
  4. Make the visibility of the ChildEntityManager dependent on the selected option

Sample code:

class Parametrization(vkt.Parametrization):
    children = vkt.OptionField("Select an option", options=["Child A", "Child B", "Child C"])
    
    child_a = vkt.ChildEntityManager("ChildA", visible=vkt.IsEqual(vkt.Lookup("children"), "Child A"))
    child_b = vkt.ChildEntityManager("ChildB", visible=vkt.IsEqual(vkt.Lookup("children"), "Child B"))
    child_c = vkt.ChildEntityManager("ChildC", visible=vkt.IsEqual(vkt.Lookup("children"), "Child C"))

Let me know if this works for you!

1 Like

Hi, thank you for your prompt response, I’ll let you know when I try it out !

1 Like

@StijnJansen

After testing it first hand, I have to say it’s a very interesting alternative and I will bring it up to our team.

One more thing is that some of our users prefer show_children_as = 'Cards' and some of our users prefer show_children_as = 'Table'.

It seemed to me that your recommendation would be an incredible opportunity to open the parent entity to see a Table and browse the parent entity to see Cards such as:
image

It’s both a question and/or a feedback as I was not able to enable both browsing and opening an entity at the same time.

After more investigation, I think this would satisfy the need I initially described, thanks @StijnJansen

1 Like

Good to hear @kassi!