Changes for page Tree Widget
Last modified by Admin on 2024/04/18 01:15
From version 15.6
edited by Admin
on 2015/09/16 00:30
on 2015/09/16 00:30
Change comment:
Imported extension [org.xwiki.platform:xwiki-platform-tree-webjar] from repository [maven-xwiki (http://nexus.xwiki.org/nexus/content/groups/public)]
To version 16.1
edited by Marius Dumitru Florea
on 2015/09/16 06:35
on 2015/09/16 06:35
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki. Admin1 +xwiki:XWiki.mflorea
- ExtensionCode.ExtensionClass[0]
-
- Description
-
... ... @@ -93,7 +93,7 @@ 93 93 94 94 {{code language="html"}} 95 95 <div class="myTree" data-url="$xwiki.getURL('Space.TreeStructure', 'get', 'outputSyntax=plain')" 96 - data-ro ot="rootNodeId" data-responsive="true" ... />96 + data-responsive="true" data-finder="true" ... /> 97 97 {{/code}} 98 98 99 99 |=Data Attribute|=Description|=Default Value ... ... @@ -104,7 +104,7 @@ 104 104 |finder|Enables [[the finder plugin>>||anchor="HFinder"]]|false 105 105 |icons|See [[core.themes.icons>>http://www.jstree.com/api/#/?q=$.jstree.defaults&f=$.jstree.defaults.core.themes.icons]]|true 106 106 |responsive|See [[core.themes.responsive>>http://www.jstree.com/api/#/?q=$.jstree.defaults&f=$.jstree.defaults.core.themes.responsive]]|true 107 -|root|The id of the root node. This is useful if you want to display a sub-tree that starts from a given node|None 107 +|root|The id of the root node. This is useful if you want to display a sub-tree that starts from a given node. It works only for dynamic or lazy-loaded trees, i.e. when the ##url## parameter is specified. Starting with version 7.2RC1 you should use the ##url## parameter instead, passing the root node id in the ##root## query string parameter (e.g. ##outputSyntax=plain&root=someNodeId##).|None 108 108 |url|The URL used to load the tree nodes, and most of the information related to the tree (context menu, path of a specified node). If not specified then the tree widget tries to create a static tree from the content of the target HTML element|None 109 109 110 110 You can also use a special CSS class 'jstree-no-links' to disable default link behaviour (i.e. clicking on a node will select the node instead of following the link). ... ... @@ -199,13 +199,20 @@ 199 199 The resource behind the specified URL must implement the following API (contract): 200 200 201 201 * Request some data 202 -** (((##?data=children&id=<parentNodeId>&offset=<offset>## 202 +** (((##?data=children&id=<parentNodeId>&offset=<offset>&showRoot=<true|false>&root=<rootNodeId>## 203 203 204 -Requests the children of the specified parent node from the specified offset. The resource decides how many child nodes to return. The response is a JSON array with node data. See [[jsTree's JSON data source>>http://www.jstree.com/docs/json/]] for more information. 204 +Requests the children of the specified parent node from the specified offset. The resource decides how many child nodes to return. The resource is expected to implement the following behaviour: 205 + 206 +* if ##id## equals '#' then the top level nodes in the tree are requested (i.e. the first level in the tree) 207 +** if ##showRoot=true## then return information about the specified root node or about the default root node in your tree model 208 +** else return information about the children of the specified root node or the children of the default root node in your tree model 209 +* else return information about the children of the specified tree node 210 + 211 +The response is a JSON array with node data. See [[jsTree's JSON data source>>http://www.jstree.com/docs/json/]] for more information. 205 205 ))) 206 -** (((##?data=path&id=<nodeId>## 213 +** (((##?data=path&id=<nodeId>&root=<rootNodeId>## 207 207 208 -Requests the path of the specified node. The response is a JSON array that contains data about all the ancestors of the specified node (including itself) starting from the root of the tree. The response is similar to the one returned when the list of child nodes is requested, only that this time the list of ancestors is returned. 215 +Requests the path of the specified node. The response is a JSON array that contains data about all the ancestors of the specified node (including itself) starting from the specified root node or from the default root node in your tree model. The response is similar to the one returned when the list of child nodes is requested, only that this time the list of ancestors is returned. 209 209 ))) 210 210 ** (((##?data=contextmenu## 211 211