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

Commit

Permalink
Renamed from TreeGrid::parentRoot to TreeGrid::parentRootValue
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrogehlen committed Nov 30, 2015
1 parent c27a3f6 commit 2dc09de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ class TreeController extends Controller
**View**

```php
use leandrogehlen\treegrid\TreeGrid;
use leandrogehlen\treegrid\TreeGrid;

<?= TreeGrid::widget([
'dataProvider' => $dataProvider,
'keyColumnName' => 'id',
'parentColumnName' => 'parent_id',
'parentRoot' => '0', //first parentId value
'parentRootValue' => '0', //first parentId value
'pluginOptions' => [
'initialState' => 'collapsed',
],
Expand Down
6 changes: 3 additions & 3 deletions TreeGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ class TreeGrid extends Widget {
public $parentColumnName;

/**
* @var string root of parent column used to build tree
* @var mixed parent column value of root elements from data
*/
public $parentRoot = null;
public $parentRootValue = null;

/**
* @var array grid column configuration. Each array element represents the configuration
Expand Down Expand Up @@ -295,7 +295,7 @@ public function renderItems()
$rows = [];
$models = array_values($this->dataProvider->getModels());
$keys = $this->dataProvider->getKeys();
$models = $this->normalizeData($models,$this->parentRoot);
$models = $this->normalizeData($models,$this->parentRootValue);
foreach ($models as $index => $model) {
$key = $keys[$index];
if ($this->beforeRow !== null) {
Expand Down

0 comments on commit 2dc09de

Please sign in to comment.