koperdog / yii2-treeview
Widget to display the ns tree as a grid
Installs: 465
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 1
Type:yii2-extension
Requires
- php: >=7.0.0
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-12-05 22:35:48 UTC
README
Widget to display the nested sets tree as a grid
Based on GridView
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist koperdog/yii2-treeview "*"
or add
"koperdog/yii2-treeview": "*"
to the require section of your composer.json
file.
Usage
Add to your model field:
public $children = null;
Has the same settings as GridView.
echo koperdog\yii2treeview\TreeView::widget([ 'dataProvider' => $dataProvider, //'depthPrefix' => ' — ', //see Additional options //'depthRoot' => 1, //see Additional options //'collaplse' => true, //see Additional options 'columns' => [ 'id', 'name', 'created_at:datetime', // ... ], ]);
The column classes the same as GridView
['class' => '\koperdog\yii2treeview\base\CheckboxColumn'], ['class' => '\koperdog\yii2treeview\base\ActionColumn'], ['class' => '\koperdog\yii2treeview\base\RadioButtonColumn'], ['class' => '\koperdog\yii2treeview\base\SerialColumn'],