jqtree 1.8.2 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/bower.json +1 -1
  2. package/package.json +20 -19
  3. package/src/dragAndDropHandler/generateHitAreas.ts +47 -43
  4. package/src/nodeElement/ghostDropHint.ts +3 -37
  5. package/src/nodeElement/index.ts +1 -1
  6. package/src/saveStateHandler.ts +43 -59
  7. package/src/version.ts +1 -1
  8. package/tree.jquery.debug.js +69 -106
  9. package/tree.jquery.debug.js.map +1 -1
  10. package/tree.jquery.js +2 -2
  11. package/tree.jquery.js.map +1 -1
  12. package/.editorconfig +0 -12
  13. package/.eslintrc +0 -48
  14. package/.github/workflows/ci.yml +0 -68
  15. package/.github/workflows/codeql-analysis.yml +0 -32
  16. package/.github/workflows/size.yml +0 -24
  17. package/.github/workflows/static.yml +0 -57
  18. package/.prettier +0 -3
  19. package/config/.postcssrc +0 -6
  20. package/config/babel.config.json +0 -11
  21. package/config/babel.coverage.config.json +0 -4
  22. package/config/jest.config.js +0 -24
  23. package/config/jest.polyfills.js +0 -14
  24. package/config/playwright.config.js +0 -18
  25. package/config/production +0 -6
  26. package/config/rollup.config.mjs +0 -71
  27. package/css/jqtree.postcss +0 -193
  28. package/devserver/devserver.js +0 -7
  29. package/devserver/devserver_scroll.js +0 -8
  30. package/devserver/index.html +0 -22
  31. package/devserver/test_index.html +0 -22
  32. package/devserver/test_scroll.html +0 -28
  33. package/devserver/test_scroll_container.html +0 -39
  34. package/docs/.ruby-version +0 -1
  35. package/docs/Gemfile +0 -5
  36. package/docs/Gemfile.lock +0 -82
  37. package/docs/_config.yml +0 -126
  38. package/docs/_entries/events/index.md +0 -6
  39. package/docs/_entries/events/tree-click.md +0 -37
  40. package/docs/_entries/events/tree-close.md +0 -15
  41. package/docs/_entries/events/tree-contextmenu.md +0 -21
  42. package/docs/_entries/events/tree-dblclick.md +0 -19
  43. package/docs/_entries/events/tree-init.md +0 -15
  44. package/docs/_entries/events/tree-load-data.md +0 -15
  45. package/docs/_entries/events/tree-loading-data.md +0 -27
  46. package/docs/_entries/events/tree-move.md +0 -73
  47. package/docs/_entries/events/tree-open.md +0 -15
  48. package/docs/_entries/events/tree-refresh.md +0 -12
  49. package/docs/_entries/events/tree-select.md +0 -28
  50. package/docs/_entries/functions/addnodeafter.md +0 -20
  51. package/docs/_entries/functions/addnodebefore.md +0 -8
  52. package/docs/_entries/functions/addparentnode.md +0 -20
  53. package/docs/_entries/functions/appendnode.md +0 -50
  54. package/docs/_entries/functions/closenode.md +0 -23
  55. package/docs/_entries/functions/destroy.md +0 -12
  56. package/docs/_entries/functions/getnodebycallback.md +0 -24
  57. package/docs/_entries/functions/getnodebyhtmlelement.md +0 -29
  58. package/docs/_entries/functions/getnodebyid.md +0 -21
  59. package/docs/_entries/functions/getselectednode.md +0 -10
  60. package/docs/_entries/functions/getstate.md +0 -19
  61. package/docs/_entries/functions/gettree.md +0 -12
  62. package/docs/_entries/functions/index.md +0 -6
  63. package/docs/_entries/functions/is-node-selected.md +0 -11
  64. package/docs/_entries/functions/isdragging.md +0 -12
  65. package/docs/_entries/functions/loaddata.md +0 -46
  66. package/docs/_entries/functions/loaddatafromurl.md +0 -55
  67. package/docs/_entries/functions/movedown.md +0 -8
  68. package/docs/_entries/functions/movenode.md +0 -15
  69. package/docs/_entries/functions/moveup.md +0 -8
  70. package/docs/_entries/functions/opennode.md +0 -44
  71. package/docs/_entries/functions/prependnode.md +0 -21
  72. package/docs/_entries/functions/refresh.md +0 -12
  73. package/docs/_entries/functions/reload.md +0 -22
  74. package/docs/_entries/functions/removenode.md +0 -12
  75. package/docs/_entries/functions/scrolltonode.md +0 -13
  76. package/docs/_entries/functions/selectnode.md +0 -45
  77. package/docs/_entries/functions/setoption.md +0 -12
  78. package/docs/_entries/functions/setstate.md +0 -8
  79. package/docs/_entries/functions/toggle.md +0 -25
  80. package/docs/_entries/functions/tojson.md +0 -13
  81. package/docs/_entries/functions/updatenode.md +0 -50
  82. package/docs/_entries/general/changelog.md +0 -434
  83. package/docs/_entries/general/demo.html +0 -28
  84. package/docs/_entries/general/downloads.md +0 -9
  85. package/docs/_entries/general/examples.md +0 -8
  86. package/docs/_entries/general/features.md +0 -15
  87. package/docs/_entries/general/index.md +0 -7
  88. package/docs/_entries/general/introduction.md +0 -9
  89. package/docs/_entries/general/requirements.md +0 -6
  90. package/docs/_entries/general/tutorial.md +0 -71
  91. package/docs/_entries/general/usecases.md +0 -15
  92. package/docs/_entries/multiple_selection/add-to-selection.md +0 -21
  93. package/docs/_entries/multiple_selection/get-selected-nodes.md +0 -10
  94. package/docs/_entries/multiple_selection/index.md +0 -9
  95. package/docs/_entries/multiple_selection/remove-from-selection.md +0 -11
  96. package/docs/_entries/node/children.md +0 -12
  97. package/docs/_entries/node/getdata.md +0 -17
  98. package/docs/_entries/node/getlevel.md +0 -13
  99. package/docs/_entries/node/getnextnode.md +0 -12
  100. package/docs/_entries/node/getnextsibling.md +0 -10
  101. package/docs/_entries/node/getnextvisiblenode.md +0 -15
  102. package/docs/_entries/node/getpreviousnode.md +0 -12
  103. package/docs/_entries/node/getprevioussibling.md +0 -10
  104. package/docs/_entries/node/getpreviousvisiblenode.md +0 -15
  105. package/docs/_entries/node/index.md +0 -13
  106. package/docs/_entries/node/parent.md +0 -10
  107. package/docs/_entries/options/animationspeed.md +0 -7
  108. package/docs/_entries/options/autoescape.md +0 -6
  109. package/docs/_entries/options/autoopen.md +0 -28
  110. package/docs/_entries/options/buttonleft.md +0 -12
  111. package/docs/_entries/options/closedicon.md +0 -26
  112. package/docs/_entries/options/data-url.md +0 -45
  113. package/docs/_entries/options/data.md +0 -46
  114. package/docs/_entries/options/datafilter.md +0 -17
  115. package/docs/_entries/options/draganddrop.md +0 -18
  116. package/docs/_entries/options/index.md +0 -6
  117. package/docs/_entries/options/keyboardsupport.md +0 -14
  118. package/docs/_entries/options/oncanmove.md +0 -22
  119. package/docs/_entries/options/oncanmoveto.md +0 -22
  120. package/docs/_entries/options/oncanselectnode.md +0 -26
  121. package/docs/_entries/options/oncreateli.md +0 -22
  122. package/docs/_entries/options/ondragmove.md +0 -20
  123. package/docs/_entries/options/ondragstop.md +0 -20
  124. package/docs/_entries/options/onismovehandle.md +0 -17
  125. package/docs/_entries/options/onloadfailed.md +0 -15
  126. package/docs/_entries/options/onloading.md +0 -22
  127. package/docs/_entries/options/openedicon.md +0 -26
  128. package/docs/_entries/options/openfolderdelay.md +0 -15
  129. package/docs/_entries/options/rtl.md +0 -18
  130. package/docs/_entries/options/savestate.md +0 -39
  131. package/docs/_entries/options/selectable.md +0 -18
  132. package/docs/_entries/options/showemptyfolder.md +0 -26
  133. package/docs/_entries/options/slide.md +0 -12
  134. package/docs/_entries/options/start_dnd_delay.md +0 -13
  135. package/docs/_entries/options/tabindex.md +0 -14
  136. package/docs/_entries/options/usecontextmenu.md +0 -14
  137. package/docs/_examples/01_load_json_data.html +0 -45
  138. package/docs/_examples/02_load_json_data_from_server.html +0 -29
  139. package/docs/_examples/03_drag_and_drop.html +0 -42
  140. package/docs/_examples/04_save_state.html +0 -46
  141. package/docs/_examples/05_load_on_demand.html +0 -68
  142. package/docs/_examples/06_autoescape.html +0 -45
  143. package/docs/_examples/07_autoscroll.html +0 -42
  144. package/docs/_examples/08_multiple_select.html +0 -60
  145. package/docs/_examples/09_custom_html.html +0 -61
  146. package/docs/_examples/10_icon_buttons.html +0 -26
  147. package/docs/_examples/11_right-to-left.html +0 -25
  148. package/docs/_examples/12_button_on_right.html +0 -26
  149. package/docs/_examples/13_drag_outside.html +0 -48
  150. package/docs/_examples/14_filter.html +0 -111
  151. package/docs/_layouts/example.html +0 -7
  152. package/docs/_layouts/page.html +0 -26
  153. package/docs/documentation.css +0 -3
  154. package/docs/index.html +0 -65
  155. package/docs/package.json +0 -22
  156. package/docs/pnpm-lock.yaml +0 -892
  157. package/docs/postcss.config.js +0 -7
  158. package/docs/static/bower.json +0 -8
  159. package/docs/static/bower_components/fontawesome/css/all.min.css +0 -9
  160. package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  161. package/docs/static/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  162. package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  163. package/docs/static/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  164. package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  165. package/docs/static/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  166. package/docs/static/bower_components/fontawesome/webfonts/fa-v4compatibility.ttf +0 -0
  167. package/docs/static/bower_components/fontawesome/webfonts/fa-v4compatibility.woff2 +0 -0
  168. package/docs/static/bower_components/jquery/dist/jquery.js +0 -10704
  169. package/docs/static/bower_components/jquery/dist/jquery.min.js +0 -2
  170. package/docs/static/bower_components/jquery-mockjax/dist/jquery.mockjax.js +0 -1061
  171. package/docs/static/documentation.js +0 -26
  172. package/docs/static/example.postcss +0 -68
  173. package/docs/static/example_data.js +0 -122
  174. package/docs/static/examples/autoescape.js +0 -17
  175. package/docs/static/examples/autoscroll.js +0 -6
  176. package/docs/static/examples/button-on-right.js +0 -13
  177. package/docs/static/examples/custom_html.js +0 -27
  178. package/docs/static/examples/drag-outside.js +0 -37
  179. package/docs/static/examples/drag_and_drop.js +0 -13
  180. package/docs/static/examples/filter.js +0 -63
  181. package/docs/static/examples/icon_buttons.js +0 -12
  182. package/docs/static/examples/load_json_data.js +0 -16
  183. package/docs/static/examples/load_json_data_from_server.js +0 -9
  184. package/docs/static/examples/load_on_demand.js +0 -19
  185. package/docs/static/examples/multiple_select.js +0 -23
  186. package/docs/static/examples/right-to-left.js +0 -11
  187. package/docs/static/examples/save_state.js +0 -11
  188. package/docs/static/monokai.css +0 -70
  189. package/docs/static/spinner.gif +0 -0
  190. package/docs/tailwind.config.js +0 -16
  191. package/sitemap.txt +0 -14
  192. package/src/playwright/.eslintrc +0 -5
  193. package/src/playwright/coverage.ts +0 -38
  194. package/src/playwright/playwright.test.ts +0 -401
  195. package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-darwin.png +0 -0
  196. package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-linux.png +0 -0
  197. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-darwin.png +0 -0
  198. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-linux.png +0 -0
  199. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-darwin.png +0 -0
  200. package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-linux.png +0 -0
  201. package/src/playwright/testUtils.ts +0 -153
  202. package/src/test/.eslintrc +0 -17
  203. package/src/test/global.d.ts +0 -1
  204. package/src/test/jqTree/accessibility.test.ts +0 -25
  205. package/src/test/jqTree/create.test.ts +0 -54
  206. package/src/test/jqTree/events.test.ts +0 -290
  207. package/src/test/jqTree/keyboard.test.ts +0 -247
  208. package/src/test/jqTree/loadOnDemand.test.ts +0 -198
  209. package/src/test/jqTree/methods.test.ts +0 -1491
  210. package/src/test/jqTree/mouse.test.ts +0 -82
  211. package/src/test/jqTree/options.test.ts +0 -595
  212. package/src/test/node.test.ts +0 -1396
  213. package/src/test/nodeUtils.test.ts +0 -21
  214. package/src/test/position.test.ts +0 -30
  215. package/src/test/support/exampleData.ts +0 -23
  216. package/src/test/support/jqTreeMatchers.ts +0 -68
  217. package/src/test/support/matchers.d.ts +0 -31
  218. package/src/test/support/setupTests.ts +0 -5
  219. package/src/test/support/testUtil.ts +0 -30
  220. package/src/test/support/treeStructure.ts +0 -39
  221. package/src/test/util.test.ts +0 -27
  222. package/tsconfig.json +0 -24
@@ -1,17 +0,0 @@
1
- ---
2
- title: getData
3
- name: node-functions-getdata
4
- ---
5
-
6
- **function getData(includeParent = false);**
7
-
8
- Get the subtree of this node.
9
-
10
- **includeParent**
11
-
12
- * **true**: include node and children
13
- * **false**: only include children (default)
14
-
15
- {% highlight js %}
16
- var data = node.getData();
17
- {% endhighlight %}
@@ -1,13 +0,0 @@
1
- ---
2
- title: getLevel
3
- name: node-functions-getlevel
4
- ---
5
-
6
- Get the level of a node. The level is distance of a node to the root node.
7
-
8
- {% highlight js %}
9
- var node = $('#tree1').tree('getNodeById', 123);
10
-
11
- // result is e.g. 2
12
- var level = node.getLevel();
13
- {% endhighlight %}
@@ -1,12 +0,0 @@
1
- ---
2
- title: getNextNode
3
- name: node-functions-getnextnode
4
- ---
5
-
6
- Get the next node in the tree. This is the next sibling, if there is one. Or, if there is no next sibling, a node further down in the tree.
7
-
8
- - Returns a node or null.
9
-
10
- {% highlight js %}
11
- const nextNode = node.getNextNode();
12
- {% endhighlight %}
@@ -1,10 +0,0 @@
1
- ---
2
- title: getNextSibling
3
- name: node-functions-getnextsibling
4
- ---
5
-
6
- Get the next sibling of this node. Returns a node or null.
7
-
8
- {% highlight js %}
9
- const nextSibling = node.getNextSibling();
10
- {% endhighlight %}
@@ -1,15 +0,0 @@
1
- ---
2
- title: getNextVisibleNode
3
- name: node-functions-getnextvisiblenode
4
- ---
5
-
6
- Get the next visible node in the tree. Does the same as using the _down_ key.
7
-
8
- This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree that is visible.
9
-
10
- - Returns a node or null.
11
- - A node is visible if all its parents are open.
12
-
13
- {% highlight js %}
14
- const nextNode = node.getNextVisibleNode();
15
- {% endhighlight %}
@@ -1,12 +0,0 @@
1
- ---
2
- title: getPreviousNode
3
- name: node-functions-getpreviousnode
4
- ---
5
-
6
- Return the previous node in the tree. This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree.
7
-
8
- - Returns a node or null.
9
-
10
- {% highlight js %}
11
- const previousNode = node.getPreviousNode();
12
- {% endhighlight %}
@@ -1,10 +0,0 @@
1
- ---
2
- title: getPreviousSibling
3
- name: node-functions-getprevioussibling
4
- ---
5
-
6
- Get the previous sibling of this node. Returns a node or null.
7
-
8
- {% highlight js %}
9
- const previousSibling = node.getPreviousSibling();
10
- {% endhighlight %}
@@ -1,15 +0,0 @@
1
- ---
2
- title: getPreviousVisibleNode
3
- name: node-functions-getpreviousvisiblenode
4
- ---
5
-
6
- Get the previous visible node in the tree. Does the same as using the _up_ key.
7
-
8
- This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree that is visible.
9
-
10
- - Returns a node or null.
11
- - A node is visible if all its parents are open.
12
-
13
- {% highlight js %}
14
- const previousNode = node.getPreviousVisibleNode();
15
- {% endhighlight %}
@@ -1,13 +0,0 @@
1
- ---
2
- title: Node functions
3
- name: node-functions
4
- section: true
5
- ---
6
-
7
- You can access a node using for example [getNodeById](#functions-getnodebyid) function:
8
-
9
- {% highlight js %}
10
- var node = $('#tree1').tree('getNodeById', 123);
11
- {% endhighlight %}
12
-
13
- The Node object has the following properties and functions:
@@ -1,10 +0,0 @@
1
- ---
2
- title: parent
3
- name: node-functions-parent
4
- ---
5
-
6
- You can access the parent of a node using the **parent** property.
7
-
8
- {% highlight js %}
9
- var parentNode = node.parent;
10
- {% endhighlight %}
@@ -1,7 +0,0 @@
1
- ---
2
- title: animationSpeed
3
- name: options-animationspeed
4
- ---
5
-
6
- Determine the speed of the slide animation. The value can be a number in millseconds, or a string like 'slow' or 'fast'. The default is 'fast'.
7
-
@@ -1,6 +0,0 @@
1
- ---
2
- title: autoEscape
3
- name: options-autoescape
4
- ---
5
-
6
- Determine if text is autoescaped. The default is true.
@@ -1,28 +0,0 @@
1
- ---
2
- title: autoOpen
3
- name: options-autoopen
4
- ---
5
-
6
- Open nodes initially.
7
-
8
- * **true**: open all nodes.
9
- * **false (default)**: do nothing
10
- * **n**: open n levels
11
-
12
- Open all nodes initially:
13
-
14
- {% highlight js %}
15
- $('#tree1').tree({
16
- data: data,
17
- autoOpen: true
18
- });
19
- {% endhighlight %}
20
-
21
- Open first level nodes:
22
-
23
- {% highlight js %}
24
- $('#tree1').tree({
25
- data: data,
26
- autoOpen: 0
27
- });
28
- {% endhighlight %}
@@ -1,12 +0,0 @@
1
- ---
2
- title: buttonLeft
3
- name: options-buttonleft
4
- ---
5
-
6
- Set the position of the toggle button; can be `true` (left) or `false` (right). The default is `true`.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- buttonLeft: false
11
- });
12
- {% endhighlight %}
@@ -1,26 +0,0 @@
1
- ---
2
- title: closedIcon
3
- name: options-closedicon
4
- ---
5
-
6
- A character or symbol to display on closed nodes. The default is '►' (►)
7
-
8
- The value can be a:
9
-
10
- - **string**. E.g. a unicode character or a text.
11
- - The text is escaped.
12
- - **html element**. E.g. for an icon
13
- - **JQuery element**. Also for an icon
14
-
15
- {% highlight js %}
16
- // String
17
- $('#tree1').tree({ closedIcon: '+' });
18
-
19
- // Html element
20
- const icon = document.createElement("span");
21
- icon.className = "icon test";
22
- $('#tree1').tree({ closedIcon: icon });
23
-
24
- // JQuery element
25
- $('#tree1').tree({ closedIcon: $('<span class="icon test" />') });
26
- {% endhighlight %}
@@ -1,45 +0,0 @@
1
- ---
2
- title: dataUrl
3
- name: options-data-url
4
- ---
5
-
6
- Load the node data from this url.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- dataUrl: '/example_data.json'
11
- });
12
- {% endhighlight %}
13
-
14
- You can also set the **data-url** attribute on the dom element:
15
-
16
- {% highlight html %}
17
- <div id="tree1" data-url="/example_data.json"></div>
18
- <script>
19
- $('#tree1').tree();
20
- </script>
21
- {% endhighlight %}
22
-
23
- You can set additional [jquery ajax options](http://api.jquery.com/jQuery.ajax/) in an object:
24
-
25
- {% highlight js %}
26
- $('#tree1').tree({
27
- dataUrl: {
28
- url: '/example_data.json',
29
- headers: {'abc': 'def'}
30
- }
31
- });
32
- {% endhighlight %}
33
-
34
- Or you can use a function:
35
-
36
- {% highlight js %}
37
- $('#tree1').tree({
38
- dataUrl: function(node) {
39
- return {
40
- url: '/example_data.json',
41
- headers: {'abc': 'def'}
42
- };
43
- }
44
- });
45
- {% endhighlight %}
@@ -1,46 +0,0 @@
1
- ---
2
- title: data
3
- name: options-data
4
- ---
5
-
6
- Define the contents of the tree. The data is a nested array of objects. This option is required.
7
-
8
- It looks like this:
9
-
10
- {% highlight js %}
11
- var data = [
12
- {
13
- name: 'node1',
14
- children: [
15
- { name: 'child1' },
16
- { name: 'child2' }
17
- ]
18
- },
19
- {
20
- name: 'node2',
21
- children: [
22
- { name: 'child3' }
23
- ]
24
- }
25
- ];
26
- $('#tree1').tree({data: data});
27
- {% endhighlight %}
28
-
29
- * **name**: name of a node (required)
30
- * Note that you can also use `label` instead of `name`
31
- * **children**: array of child nodes (optional)
32
- * **id**: int or string (optional)
33
- * Must be an int or a string
34
- * Must be unique in the tree
35
- * The `id` property is required if you use the multiple selection feature
36
-
37
- You can also include other data in the objects. You can later access this data.
38
-
39
- For example, to add an id:
40
-
41
- {% highlight js %}
42
- {
43
- name: 'node1',
44
- id: 1
45
- }
46
- {% endhighlight %}
@@ -1,17 +0,0 @@
1
- ---
2
- title: dataFilter
3
- name: options-datafilter
4
- ---
5
-
6
- Process the tree data from the server.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- dataUrl: '/my/data/',
11
- dataFilter: function(data) {
12
- // Example:
13
- // the server puts the tree data in 'my_tree_data'
14
- return data['my_tree_data'];
15
- }
16
- });
17
- {% endhighlight %}
@@ -1,18 +0,0 @@
1
- ---
2
- title: dragAndDrop
3
- name: options-draganddrop
4
- ---
5
-
6
- Turn on dragging and dropping of nodes.
7
-
8
- * **true**: turn on drag and drop
9
- * **false (default)**: do not allow drag and drop
10
-
11
- Example: turn on drag and drop.
12
-
13
- {% highlight js %}
14
- $('#tree1').tree({
15
- data: data,
16
- dragAndDrop: true
17
- });
18
- {% endhighlight %}
@@ -1,6 +0,0 @@
1
- ---
2
- title: Tree options
3
- name: tree-options
4
- section: true
5
- ---
6
-
@@ -1,14 +0,0 @@
1
- ---
2
- title: keyboardSupport
3
- name: options-keyboardsupport
4
- ---
5
-
6
- Enable or disable keyboard support. Default is enabled.
7
-
8
- Example: disable keyboard support.
9
-
10
- {% highlight js %}
11
- $('#tree1').tree({
12
- keyboardSupport: false
13
- });
14
- {% endhighlight %}
@@ -1,22 +0,0 @@
1
- ---
2
- title: onCanMove
3
- name: options-oncanmove
4
- ---
5
-
6
- You can override this function to determine if a node can be moved.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- data: data,
11
- dragAndDrop: true,
12
- onCanMove: function(node) {
13
- if (! node.parent.parent) {
14
- // Example: Cannot move root node
15
- return false;
16
- }
17
- else {
18
- return true;
19
- }
20
- }
21
- });
22
- {% endhighlight %}
@@ -1,22 +0,0 @@
1
- ---
2
- title: onCanMoveTo
3
- name: options-oncanmoveto
4
- ---
5
-
6
- You can override this function to determine if a node can be moved to a certain position.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- data: data,
11
- dragAndDrop: true,
12
- onCanMoveTo: function(movedNode, targetNode, position) {
13
- if (targetNode.isMenu) {
14
- // Example: can move inside menu, not before or after
15
- return (position == 'inside');
16
- }
17
- else {
18
- return true;
19
- }
20
- }
21
- });
22
- {% endhighlight %}
@@ -1,26 +0,0 @@
1
- ---
2
- title: onCanSelectNode
3
- name: options-oncanselectnode
4
- ---
5
-
6
- You can set a function to override if a node can be selected. The function gets a node as parameter, and must return true or false.
7
-
8
- For this to work, the option 'selectable' must be 'true'.
9
-
10
- {% highlight js %}
11
- // Example: nodes with children cannot be selected
12
- $('#tree1').tree({
13
- data: data,
14
- selectable: true
15
- onCanSelectNode: function(node) {
16
- if (node.children.length == 0) {
17
- // Nodes without children can be selected
18
- return true;
19
- }
20
- else {
21
- // Nodes with children cannot be selected
22
- return false;
23
- }
24
- }
25
- });
26
- {% endhighlight %}
@@ -1,22 +0,0 @@
1
- ---
2
- title: onCreateLi
3
- name: options-oncreateli
4
- ---
5
-
6
- The function is called for each created node. You can use this to define extra html.
7
-
8
- The function is called with the following parameters:
9
-
10
- * **node**: Node element
11
- * **$li**: Jquery li element
12
- * **isSelected**: is the node selected (true/false)
13
-
14
- {% highlight js %}
15
- $('#tree1').tree({
16
- data: data,
17
- onCreateLi: function(node, $li, isSelected) {
18
- // Add 'icon' span before title
19
- $li.find('.jqtree-title').before('<span class="icon"></span>');
20
- }
21
- });
22
- {% endhighlight %}
@@ -1,20 +0,0 @@
1
- ---
2
- title: onDragMove
3
- name: options-ondragmove
4
- ---
5
-
6
- Function that is called when a node is dragged **outside** the tree. This function is called while the node is being dragged.
7
-
8
- * Also see the ``onDragStop`` option.
9
- * The function signature is function(node, event);
10
-
11
- {% highlight js %}
12
- function handleMove(node: Node, e: JQueryEventObject) {
13
- //
14
- }
15
-
16
- $tree.tree({
17
- dragAndDrop: true,
18
- onDragMove: handleMove,
19
- });
20
- {% endhighlight %}
@@ -1,20 +0,0 @@
1
- ---
2
- title: onDragStop
3
- name: options-ondragstop
4
- ---
5
-
6
- Function that is called when a node is dragged **outside** the tree. This function is called when user stops dragging.
7
-
8
- * Also see the ``onDragMove`` option.
9
- * The function signature is function(node, event);
10
-
11
- {% highlight js %}
12
- function handleStop(node: Node, e: JQueryEventObject) {
13
- //
14
- }
15
-
16
- $tree.tree({
17
- dragAndDrop: true,
18
- onDragStop: handleMove,
19
- });
20
- {% endhighlight %}
@@ -1,17 +0,0 @@
1
- ---
2
- title: onIsMoveHandle
3
- name: options-onismovehandle
4
- ---
5
-
6
- You can override this function to determine if a dom element can be used to move a node.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- data: data,
11
- onIsMoveHandle: function($element) {
12
- // Only dom elements with 'jqtree-title' class can be used
13
- // as move handle.
14
- return ($element.is('.jqtree-title'));
15
- }
16
- });
17
- {% endhighlight %}
@@ -1,15 +0,0 @@
1
- ---
2
- title: onLoadFailed
3
- name: options-onloadfailed
4
- ---
5
-
6
- When loading the data by ajax fails, then the option **onLoadFailed** is called.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- dataUrl: '/my/data/',
11
- onLoadFailed: function(response) {
12
- //
13
- }
14
- });
15
- {% endhighlight %}
@@ -1,22 +0,0 @@
1
- ---
2
- title: onLoading
3
- name: options-onloading
4
- ---
5
-
6
- The onLoading parameter is called when the tree data is loading. This gives us the opportunity to display a loading signal.
7
-
8
- Callback looks like this:
9
-
10
- ```js
11
- function (isLoading, node, $el)
12
- ```
13
-
14
- * **isLoading**: boolean
15
- * true: data is loading
16
- * false: data is loaded
17
- * **node**:
18
- * Node: if a node is loading
19
- * null: if the tree is loading
20
- * **$el**:
21
- * if a node is loading this is the `li` element
22
- * if the tree is loading is the `ul` element of the whole tree
@@ -1,26 +0,0 @@
1
- ---
2
- title: openedIcon
3
- name: options-openedicon
4
- ---
5
-
6
- A character or symbol to display on opened nodes. The default is '&amp;#x25bc;' (&#x25bc;)
7
-
8
- The value can be a:
9
-
10
- - **string**. E.g. a unicode character or a text.
11
- - The text is escaped.
12
- - **html element**. E.g. for an icon
13
- - **JQuery element**. Also for an icon
14
-
15
- {% highlight js %}
16
- // String
17
- $('#tree1').tree({ openedIcon: '-' });
18
-
19
- // Html element
20
- const icon = document.createElement("span");
21
- icon.className = "icon test";
22
- $('#tree1').tree({ openedIcon: icon });
23
-
24
- // JQuery element
25
- $('#tree1').tree({ openedIcon: $('<span class="icon test" />') });
26
- {% endhighlight %}
@@ -1,15 +0,0 @@
1
- ---
2
- title: openFolderDelay
3
- name: options-openfolderdelay
4
- ---
5
-
6
- Set the delay for opening a folder during drag-and-drop. The delay is in milliseconds. The default is 500 ms.
7
-
8
- * Setting the option to `false` disables opening folders during drag-and-drop.
9
-
10
- {% highlight js %}
11
- $('#tree1').tree({
12
- dataUrl: '/my/data/',
13
- openFolderDelay: 1000
14
- });
15
- {% endhighlight %}
@@ -1,18 +0,0 @@
1
- ---
2
- title: rtl
3
- name: options-rtl
4
- ---
5
-
6
- Set right-to-left support (true / false). Default is false.
7
-
8
- {% highlight js %}
9
- $('#tree1').tree({
10
- rtl: true
11
- });
12
- {% endhighlight %}
13
-
14
- You can also set the option using ``data-rtl``.
15
-
16
- {% highlight html %}
17
- <div id="tree1" data-url="/data" data-rtl></div>
18
- {% endhighlight %}
@@ -1,39 +0,0 @@
1
- ---
2
- title: saveState
3
- name: options-savestate
4
- ---
5
-
6
- Save and restore the state of the tree automatically. The state is saved in localstorage.
7
-
8
- For this to work, you should give each node in the tree data an id field:
9
-
10
- {% highlight js %}
11
- {
12
- name: 'node1',
13
- id: 123,
14
- childen: [
15
- name: 'child1',
16
- id: 124
17
- ]
18
- }
19
- {% endhighlight %}
20
-
21
- * **true**: save and restore state in localstorage
22
- * **false (default)**: do nothing
23
- * **string**: save state and use this name to store
24
-
25
- {% highlight js %}
26
- $('#tree1').tree({
27
- data: data,
28
- saveState: true
29
- });
30
- {% endhighlight %}
31
-
32
- Example: save state in key 'tree1':
33
-
34
- {% highlight js %}
35
- $('#tree1').tree({
36
- data: data,
37
- saveState: 'tree1'
38
- });
39
- {% endhighlight %}