Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.12 KB

RENDERER.MD

File metadata and controls

52 lines (37 loc) · 1.12 KB

NodeItemTree - Render

Do you want render tree for user, etc. for choose some node?

$tree->render();

Tree can looks like in above pictures

Alt text Alt text Alt text

After choose node tree looks like

Alt text

Don´t forget link css styles

<link rel="stylesheet" href="css/helbrary-tree.css">

Customize of rendering

Set active node

$renderer = $tree->getRenderer();
$renderer->setActiveNode(5);

Customize choose button

$renderer = $tree->getRenderer();
$renderer->setActionItemTemplate('pathToMyTemplate.latte');

// default action item template - chooser.latte

<a class="helbrary-tree-chooser" data-key="{$node->getKey()}">
Choose
</a>

Do you want set key of choose node to some input?

<input type="text" id="my-input">

$renderer = $tree->getRenderer();
$renderer->setTargetInputForChooseNode('my-input');

// now when I choose some node will be set value of input my-input to key of choose node