You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting Data, Reordering and Change Parent actions has default implementations, but you can implement and use your own ones, just by changing a routes `'treeDataRoute', 'reorderAction', 'changeParentAction'`.
82
+
83
+
Nested Set
84
+
----------
85
+
Nested set can work in single or multy root modes. Single root mode by default.
86
+
For using multi root mode you have to have `tree` (or other name you like) column in your database table to store root id. And define this name in all necessary config places (see below).
63
87
88
+
In the MenuController:
89
+
90
+
```php
91
+
use devgroup\JsTreeWidget\actions\nestedset\FullTreeDataAction;
92
+
use devgroup\JsTreeWidget\actions\nestedset\NodeMoveAction;
93
+
...
94
+
public function actions()
95
+
{
96
+
return [
97
+
'getTree' => [
98
+
'class' => FullTreeDataAction::class,
99
+
'className' => Menu::class,
100
+
'rootAttribute' => 'tree', //omit for single root mode
101
+
],
102
+
'treeReorder' => [
103
+
'class' => NodeMoveAction::class,
104
+
'className' => Menu::class,
105
+
'rootAttribute' => 'tree', //omit for single root mode
Getting Data and Node Movements actions has the default implementations and are independent from side `NestedSet behaviors`. But you also can use your own implementation.
65
127
66
128
`TreeWidget` will register bundle `JsTreeAssetBundle`, but you may want to include it as dependency in your main bundle(ie. for minification purpose).
0 commit comments