Tree::Simple::View::DHTML is a Perl class for viewing Tree::Simple hierarchies in DHTML.
SYNOPSIS
use Tree::Simple::View::DHTML;
## a simple example
# use the defaults (an unordered list with no CSS)
my $tree_view = Tree::Simple::View::DHTML->new($tree);
## more complex examples
# using the CSS properties
my $tree_view = Tree::Simple::View::DHTML->new($tree => (
list_type => "ordered",
list_css => "list-style: circle;",
list_item_css => "font-family: courier;",
expanded_item_css => "font-family: courier; font-weight: bold",
link_css => "text-decoration: none;"
));
# using the CSS classes
my $tree_view = Tree::Simple::View::DHTML->new($tree => (
list_css_class => "myListClass",
list_item_css_class => "myListItemClass",
expanded_item_css_class => "myExpandedListItemClass",
link_css_class => "myListItemLinkClass"
));
# mixing the CSS properties and CSS classes
my $tree_view = Tree::Simple::View::DHTML->new($tree => (
list_css => "list-style: circle;",
list_item_css => "font-family: courier;",
expanded_item_css_class => "myExpandedListItemClass",
link_css_class => "myListItemLinkClass"
# format complex nodes with a function
node_formatter => sub {
my ($tree) = @_;
return "" . $tree->getNodeValue()->description() . "";
},
# add a radio button element to the tree
# with the name of 'tree_id'
radio_button => 'tree_id'
));
# print out the javascript nessecary for the DHTML
# functionality of this tree
print $tree_view->javascript();
# print out the tree fully expanded
print $tree_view->expandAll();
# print out the tree expanded along a given path (see below for details)
print $tree_view->expandPath("Root", "Child", "GrandChild");
Product's homepage
Requirements:
· Perl