mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Added an parameter to decide, if the root tree node should be expanded or not
Related to issue #158, but it does not work due to a very buggy treeview...
This commit is contained in:
parent
cb16819340
commit
e7fa1ebcb8
5 changed files with 17 additions and 5 deletions
|
@ -204,14 +204,14 @@ final class TreeViewNode implements JsonSerializable
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setExpanded(?bool $selected): self
|
||||
public function setExpanded(?bool $selected = true): self
|
||||
{
|
||||
//Lazy loading of state, so it does not need to get serialized and transfered, when it is empty.
|
||||
if (null === $this->state) {
|
||||
$this->state = new TreeViewNodeState();
|
||||
}
|
||||
|
||||
$this->state->setExpanded(true);
|
||||
$this->state->setExpanded($selected);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue