Hi I'll try my best to explain what I'm struggling with, I need to make a kind of navigation system for displaying values stored in Firebase the database, the main idea is when you click a node, the subnodes display, when you click one of those nodes another subnode displays and so on untill you get to the last part where it shows you the BPM, OXY and TEMP values.
I'm simulating with my mouse how the user would navigate thru the database. Sorry if it's confusing.
I once did a collapsible view in a Label, but on a different type of data structure in back.
Here's a link:
If you ask Firebase to get the empty tag at root of your database, it should return the entire database, as nested dictionaries and lists.
Maybe there might be parts you can use.
Here's another attempt, specific to Firebase:
And this sample unrolls the whole structure, regardless of where you got it:
And here's another one, kinda flat:
So after surveying work that I did in the past and forgot about till now, here's some ideas on the kind of data structure you would need if you wanted to do this in a ListView with expandable and collapsible subtrees.
Keep two parallel lists:
-
A table of paths (lists of indexes or keys) and values or value summaries matching the ListView Elements, enough to remember how you got to that Element and whether or not it is open [-] or closed [+] (You can use arrows too if you can find the Unicode)
-
The Elements for your ListView, matching that first list
After Selection of a ListView Element, use the SelectionIndex to see if this was a tree node, and open or close it by either inserting into or deleting from the matching lists.
I don't think I ever carried it this far.
Thanks a lot for your help, I'm still trying to make it work but now I got more solid ideas!
I actually thought about doing something like this to set a route:
It doesn't work yet at all but my idea is to get something like:
main route/
(the years get displayed)
2023
2024
(when you select an item it gets joined to the main route like a string so it gets kinda like this)
main route/2024
(displays months)
1
2
3
4
(you select a month and it gets added to the route string)
main route/2024/2
Just tried it and I get stuck after choosing the month :((
Not sure why
I will show my data layout later, perhaps it is slightly different to yours...
registros is a top level node below the project url.
I entered all the data directly into the firebase console.
and registros is set as the default "starting" projectBucket