Category / Section
How to open the Navigation link in new window?
1 min read
The TreeView component provides built-in navigation URL options for same window(tab). You can open the navigation links on next window using the drawNode method of the TreeView component. The following code sample demonstrates how to open the navigation link in 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'); } }
Sample: https://stackblitz.com/edit/angular-s68thf-7wzhki?file=default.component.ts