Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
Added info how to use provider
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrogehlen committed Mar 15, 2016
1 parent cda6908 commit 61b7ae7
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class TreeController extends Controller
$query = Tree::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => false
]);

return $this->render('index', [
Expand All @@ -95,20 +96,20 @@ class TreeController extends Controller
use leandrogehlen\treegrid\TreeGrid;

<?= TreeGrid::widget([
'dataProvider' => $dataProvider,
'keyColumnName' => 'id',
'parentColumnName' => 'parent_id',
'parentRootValue' => '0', //first parentId value
'pluginOptions' => [
'initialState' => 'collapsed',
],
'columns' => [
'name',
'id',
'parent_id',
['class' => 'yii\grid\ActionColumn']
]
]); ?>
'dataProvider' => $dataProvider,
'keyColumnName' => 'id',
'parentColumnName' => 'parent_id',
'parentRootValue' => '0', //first parentId value
'pluginOptions' => [
'initialState' => 'collapsed',
],
'columns' => [
'name',
'id',
'parent_id',
['class' => 'yii\grid\ActionColumn']
]
]); ?>
```


0 comments on commit 61b7ae7

Please sign in to comment.