NAME

JQuery::Treeview - shows a information as a tree.

VERSION

Version 1.00

SYNOPSIS

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 ;
    

DESCRIPTION

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

f

A folder or node

c

The node is initially closed

o

The node is initially open

(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:

list

The list in the format show above

id

The css id of the element

separator

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

addToJQuery

The JQuery container

treeControlId

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.

treeControlText

These are the text items needed for the treeControlId

defaultState

The default state of the tree, either open or closed.

highlightNodes

If highlightNodes is set, then nodes will be underlined

highlightLeaves

If highlightLeaves is set, then the leaves will be underlined

type

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.

rm

This is the runmode to be used when running an external program

remoteProgram

This is the name of the remote program to be used when an item is pressed.

FUNCTIONS

new

Instantiate the object.

HTML

Produce the HTML code

HTMLControl

Produce the HTML code for the control

AUTHOR

Peter Gordon, <peter at pg-consultants.com>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc JQuery

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

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.