In article <B059671903C6D211A0D500C0F0301C7910C83D@kubrick.mop.no>, Alexander Staubo <alex@mop.no> wrote:
I'm thinking of exploiting the #tree tag in conjunction with one or more SQL method. Say I have a hierarchical-ish table with id/parent_id references, and I'd like to display this information in a nice collapsible tree. Possible? Possibly the expr= or branches_expr= arguments to #tree could evaluate the result of an SQL method, although it sounds to me like this would require one query per tree level.
I did something like this with a TinyTable once for fun. I made a brain that provided a tpValues method which recursively queries for children. I had to modify TinyTables to use itself as the acquisition parent for results so it could find itself to use in the recursive queries (it normally doesn't do this, because that causes unexpected acquisition inside an #in). I never bothered to find a cleaner way of doing this since I was just fooling around.
Possibly you could put the query results of the complete table in a temporary variable and evaluate on that?
That'd be a better way. It shouldn't be hard to write an external method that "treeifys" any Results instance, so you can #tree anything that you can #in on.