p-tree and canDeactivate

UI Components for Angular
Post Reply
jmanko
Posts: 16
Joined: 19 Nov 2013, 20:24

26 Jun 2020, 23:20

Is there any way for a `p-tree` to hook into Angular's `canDeactivate`?

Code: Select all

<p-tree class="large" 
             [value]="treeNodes" 
             selectionMode="single" 
             [(selection)]="selectedNode"
             (onNodeSelect)="onNodeClick($event)">
    </p-tree>
(onNodeClick) grabs the node and navigates to it's view (that info is added to the node object). But if an existing component is marked with a canDeactivate, which triggers a dialog yes/no to the user, the tree still selects the clicked node.

The structure is of the components is something like:

Code: Select all

[component top]
   [component tree]
   <router-outlet></router-outlet>
[/component top]

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests