JQuery::Treeview - shows a information as a tree.
JQuery::Treeview shows a information as a tree.
use JQuery; use JQuery::Treeview; my $list =<<EOD; folder 1(fc) file 1.1 file 1.2 file 1.3 folder 1.2(f) file 2.1 file 2.2 file 2.3 folder 1.3(fc) folder 1.4(f) file 1.4 folder 2(f) file 2.1 folder 3(f) EOD my $tree = JQuery::Treeview->new(list => $list, id => 'mytree', separator => "/", addToJQuery => $jquery, treeControlId => 'myTreeControl', treeControlText => ['Collapse All','Expand All','Toggle All'], defaultState => 'open', highlightNodes => 1, highlightLeaves => 1, highlightUnderline => 1, type => 'directory', rm => 'MyTreeView', debug => 0, remoteProgram => '/cgi-bin/jquery_treeview_results.pl') ; my $htmlControl = $tree->HTMLControl ; my $html = $tree->HTML ;
Treeview shows data in a tree format. For an example see http://jquery.bassistance.de/treeview/
The simplest way to present the data is in the format shown above. Each indentation represents another level. The letters in brackets stand for
(Putting all this information in a Perl array with embedded hashes is possible, but really ugly, and hard to debug visually. I tried, but didn't like the result.)
The other parameters are:
The list in the format show above
The css id of the element
When an item is pressed, the it and all ancestors are concatenated and sent to the calling program. The item called 'data' contains just the data as shown at the leaf or node. 'data1' gives the whole path, each element being separated by the separator.
In other words, you might get data=myfile, and data1=dir/dir1/dir2/myfile
The JQuery container
The id of a control element. JQuery::Treeview can generate the control HTML, which is just a set of links allowing the user to manipulate the tree. The user can collapse all, expand all, and toggle all.
These are the text items needed for the treeControlId
The default state of the tree, either open or closed.
If highlightNodes is set, then nodes will be underlined
If highlightLeaves is set, then the leaves will be underlined
If type is 'directory', the folder and file icons will be used in the display. If the type is gray, red or black no icons are used.
This is the runmode to be used when running an external program
This is the name of the remote program to be used when an item is pressed.
Instantiate the object.
Produce the HTML code
Produce the HTML code for the control
<peter at pg-consultants.com>
Please report any bugs or feature requests to
bug-jquery-taconite at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=JQuery. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Copyright 2007 Peter Gordon, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.