Skip to content

Commit 4740ea8

Browse files
authored
Update SelectTree.php
adding 'parent' => $result->{$this->getParentAttribute()}, enables us to do additional customisation in the afterStateUpdated hook. eg. auto updating parent ids on children selection
1 parent f8ddfd9 commit 4740ea8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/SelectTree.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ private function buildNode($result, $resultMap, $disabledOptions, $hiddenOptions
185185
$node = [
186186
'name' => $result->{$this->getTitleAttribute()},
187187
'value' => $result->getKey(),
188+
'parent' => $result->{$this->getParentAttribute()},
188189
'disabled' => in_array($result->getKey(), $disabledOptions),
189190
'hidden' => in_array($result->getKey(), $hiddenOptions),
190191
];

0 commit comments

Comments
 (0)