JQuery TreeView Widget ========================== Installation ------------ :: easy_install tw.jquery Usage ----- The TreeView widget supports the following optional parameters: Parameters: ~~~~~~~~~~~ * **treeDiv** The id of the div element which contains the unordered list to be rendered as a tree. (*Default:* treeDiv = tree) For example the widget is instantiated as:: from tw.jquery import TreeView myTree = TreeView(treeDiv='navTree') This tree is served up to the user via a controller method like this:: @expose('mypackage.templates.navtree') def navtree(self, **kw): pylons.c.w.tree = myTree return dict() And your template would display the tree like this:: ${tmpl_context.w.tree()} The template should have a div with id navTree containing an unordered list as::
Note that some items have class="closed". These would show up as collapsed nodes. Here is the resulting field when viewed from a browser: .. image:: http://docs.turbogears.org/2.0/RoughDocs/ToscaWidgets/Cookbook/TreeView?action=AttachFile&do=get&target=treeview.png :alt: example TreeView