🌲 tree widget, for a self referencing table?

Here is an example of a self-referencing table, describing an organizational chart:

https://docs.getgrist.com/k7k8swR9W6SY/Gestione-libreria?utm_id=share-doc

It would be very useful to have a tree widget to better show this hierarchical data.

How can I help you developing such a widget?
Can you point me to any reference?

Thank you,
Emanuele

Here is a POC : Tests - Grist
You may re-use it by creating a custom widget with the same URL, copying the code you’ll get by clicking on “Open Configuration” (in three-dots menu), and adapting the value of the TABLE, COLUMNS, REF and COLLAPSED variables (lines 16 - 19).

2 Likes

Indeed a great POC! Thank you.

I tried it, and added fields.
It’s exactly what we need.

@natalie-grist I suppose this one too deserves to go into the next Grist News Summary, isn’t it?
And probably, after a little more polishment, also as an official widget.

1 Like

JPeron is on fire.

He created in a few days

1 - A signature widget (you draw your signature on the screen)
2 - a tree style menu/directory widget
3 - An Action Button widget allowing no description and allowing multiple buttons!!

@natalie-grist

1 Like

To be more exact, I’m on holidays… It won’t last forever!

nooooooo

aren´t you from Europe? Winter holidays?

Sure. February holidays till Sunday.

Summer here right now. And I never take vacations on winter (June 21 to September 21)

@Rogerio_Penna @Emanuele_Gissi we are keeping track of these exciting developments, to say the least! :heart_eyes:

1 Like

It seems as if this widget has been unset. Was hoping to share it in the newsletter - would you be OK with reincorporating it (if you’re back from holidays, that is!).

Wasn’t it merged in the main Grist widget repository?

No, it wasn’t, my mistake.

Here you are… and long live snapshots! I took the occasion to have it reload onRecords, so that changes to the data source are reflected without needing manual reload. I also handled the case of infinite recursion in the tree, and added a collapse / expand button.

1 Like

Another small enhancement: the tree widget now can act as a selector (cf. sample).

thank you very very much! and that bidirectional selector work is extremely cool.

It wasn’t really bidirectional selector, but you gave me the idea, so now it is.

1 Like

I promise that wasn’t a trick to get you to do more work – just me trying to use big words. Regardless, a nice touch!

Just added, for convenience:

  • up / down arrow navigation;
  • right / left arrow to toggle collapse row;
  • Ctrl+right or Ctrl+left to collapse or expand all.
1 Like