<ejs-treeview id="treeMaterial" #treeMaterial [fields]="treeFields" [allowDragAndDrop]="true" (nodeExpanding)="nodeExpanding($event)" [loadOnDemand]="true"</ejs-treeview>
<ejs-contextmenu id='contextmenu' #contextmenu target='#treeMaterial' (beforeOpen)='beforeOpen($event)' [items]='menuItems'></ejs-contextmenu> |
@ViewChild ('treeMaterial') treeView: TreeViewComponent;
public beforeOpen(args: BeforeOpenCloseMenuEventArgs) {
let treeId: string = this.treeView.selectedNodes[0];
} |
public beforeopen(args: BeforeOpenCloseMenuEventArgs) {
if (args.event.target.closest("li")) {
this.targetNode = args.event.target.closest("li");
}
} |