I'm not aware of any modules to do this (which is not to say they don't exist, just that I've never had the need to do something like this), but its a relatively simple problem.
The first thing to do is to get the data structure in place. Something like this might do the job:
{ name => 'node_name' id => 'node_id' children => [ # Hash refs just like the example here # but nested ] }
You could populate it by getting the data with a few SQL queries. First grab the nodes where there is no parent id, then, for each one grab the nodes where the id is the same as the node you are looking at. A recursive function is likely to be your friend here. (Solutions involving grabbing all the data at once and then finding children in Perl might be more efficient).
Next you implement the view in HTML. Outputting a series of nested lists is probably a good bet. You can include an extra list item in each on with an "Add node here" link.
You can them implement expanding/collapsing nodes with JavaScript, or use Ajax to avoid having to leave the page to fill in details of the new node and then repopulate the entire tree.
In reply to Re: Web Interface to Tree Structure Pulled from DB.
by dorward
in thread Catalyst Interface to Display Tree Structure Pulled from DB.
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |