Articles in this section
Category / Section

How to open the Navigation link in new window?

1 min read

This article explains how to open the navigation link in a new window.

The TreeView component provides built-in navigation URL options for the same window (tab). You can open the navigation links in the next window using the drawNode method of the TreeView component. The following code sample demonstrates how to open the navigation link in the next window.


[HTML]

<ejs-treeview id="tree1" [fields]='field' (drawNode)='drawNode($event)'></ejs-treeview>

 

[Script]

public drawNode(args: DrawNodeEventArgs ): void { 
 //get the tree node anchor tag element
  let aTag: Element = args.node.querySelector("a"); 
  if (aTag) { 
    //Set the target value for anchor tag
    aTag.setAttribute('target','_blank'); 
  } 
 } 
 

 

Refer to the working sample for additional details and implementation: Sample


 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied