Download the PHP package devgroup/yii2-jstree-widget without Composer
On this page you can find all versions of the php package devgroup/yii2-jstree-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-jstree-widget
yii2-jstree-widget
jsTree tree widget for yii2.
Current state: unstable.
Description
This extension allows you to display and manage hierarchical data structures from your database using jsTree.
For now following data structure types are supported:
Usage example
For example, we have model Menu that represents our structured data. And MenuController for management purposes.
Adjacency List
In the MenuController:
In your view file call the widget in the right place:
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'
.
Nested Set
Nested set can work in single or multy root modes. Single root mode by default.
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).
In the MenuController:
In the view file:
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.
TreeWidget
will register bundle JsTreeAssetBundle
, but you may want to include it as dependency in your main bundle(ie. for minification purpose).
ContextMenuHelper
creates JsExpression
for handling context menu option click. It automatically adds all data
attributes from item link(<a>
tag) if it is not specified exactly(as in 'open' menu item).
All versions of yii2-jstree-widget with dependencies
bower-asset/jstree Version *
devgroup/yii2-tag-dependency-helper Version ~1.5