Selection is enabled by setting selectionMode to one of possible values: single or multiple. In the single mode, a single TreeNode is expected as the value of the selection property. In the multiple mode, an array is expected. For example:
<p-organizationChart [value]="data"
selectionMode="single" [(selection)]="selectedNode">
</p-organizationChart>
The organization chart supports two events:
Name | Parameters | Description |
onNodeSelect |
|
Callback invoked when a node is selected by a click. |
onNodeUnselect |
|
Callback invoked when a node is unselected by a click. |
Â
Let's extend the previous developed organization chart as shown here:
<p-organizationChart [value]="data" styleClass="company"
selectionMode="single" [(selection)]="...