Tree
Wrapper for awesome http://mbraak.github.io/jqTree/, (*1)
--, (*2)
Lets say you have model Category with following structure:, (*3)
Then name, description and so on., (*4)
This widget will help you to create nice tree, which allows you to sort and change structre by drug and drop, (*5)
Twitter bootstrap 2 would be nice, but not necessary, (*6)
1) Place this widget in "extensions" folder 2) Probably you have folder named "jqtreewidget" in lowercase. Rename it to "JQTreeWidget", (*7)
If your model doesn't have 'status' or similar field, then just remove 'statusField', (*8)
widget('ext.JQTreeWidget.JQTreeWidget', array( 'models' => Category::find()->orderBy('sorter')->all(), // It has to be ordered by **'orderField'** 'modelName' => 'Category', 'parentIdField' => 'parent_id', 'statusField' => 'active', 'orderField' => 'sorter', 'withChildren' => false, //default = true 'leafName' => function($model){ return Html::a($model->name, ['/content/page/update', 'id'=>$model->id]); }, )) ?>