| | 1 | = Demo = |
| | 2 | http://vm7.target.rug.nl/catalogue/molgenis.do?__target=main&select=LLcatalogueTreePlugin (test/test) |
| | 3 | |
| | 4 | = Location = |
| | 5 | |
| | 6 | |
| | 7 | {{{ |
| | 8 | /molgenis/src/org/molgenis/framework/ui/html/JQueryTreeView.java |
| | 9 | |
| | 10 | }}} |
| | 11 | |
| | 12 | {{{ |
| | 13 | and /molgenis/src/org/molgenis/framework/ui/html/JQueryTreeViewElement.java |
| | 14 | |
| | 15 | }}} |
| | 16 | |
| | 17 | JQueryTreeView.java contains the constructor , renderTree() and toHtml(). |
| | 18 | The function renderTree() is used by toHtml() is order to print each specific node to html <li>.The function toHtml() is actually serving the whole tree if called . Contains the css and js references as well as the jquery functionality. |
| | 19 | About the tree: No Nodes collapsed explicitly. Node is manually closed then by giving its LI element a "closed"(/opened) CSS class. |
| | 20 | The animation is enabled, and the speed is "normal" (this can be modified). "Cookie" persistence enabled, causing the current tree state to be persisted. Dynamically adding a sub tree to the existing tree demonstrated. |
| | 21 | |
| | 22 | ==How to instantiate and use it == |
| | 23 | * Inside your plugin instantiate a tree object by calling |
| | 24 | |
| | 25 | {{{ |
| | 26 | JQueryTreeView<JQueryTreeViewElement> treeView |
| | 27 | |
| | 28 | }}} |
| | 29 | |
| | 30 | *You will probably need a function like addingObjectsToTree which will actually create the JQueryTreeViewElemen and fill the JQueryTreeView. |
| | 31 | *For the purposes of the measurements tree in LLcatalogueTree plugin(/molgenis_apps/apps/lifelines/plugins/LLcatalogueTree) we have instantiated the JQuery tree in public class JQueryTreeViewElementMeasurement extends JQueryTreeViewElement{ where the elements of the tree are measurements. |
| | 32 | * There is an example in LLcatalogueTree |
| | 33 | public void addingMeasurementTotree(List<String> c |
| | 34 | Also public String getTreeView() { return treeView.toHtml(); } will call render the tree in your ftl. |