<ng-template
#nodeTemplate="" let-data="">
<div id="waiting">
<div
id="waitdetails">
<div
id="waitlist">{{data.Id}}</div>
<div
id="waitcategory">{{data.Libelle}} - {{data.Statut}}</div>
</div>
</div>
</ng-template>
</ejs-treeview>
// CREATING
TREEVIEW
const
componentFactory = this._cfr.resolveComponentFactory(TreeViewComponent);
const componentRef =
componentFactory.create(this.injector);
componentRef.instance.allowDragAndDrop
= true;
componentRef.instance.cssClass
= 'treeview-external-drag treeview-generated';
componentRef.instance.NG-TEMPLATE( ?????
const
domElem = (componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0] as
HTMLElement;
// PART I
DON’T KNOW HOW TO IMPLEMENT : ????????
//
Integration of treeview in the page
….appendChild(domElem);
modifyComponent() {
this.componentRef.instance.fields = { dataSource: this.hierarchicalData2, id: 'id', text: 'name', child: 'subChild' };
} |
// Triggers when node is clicked
onClick(args){
var icon = args.event.target;
if(icon.classList.contains('e-icon-expandable')){
alert("Node collapsed")
}
else if(icon.classList.contains('e-icon-collapsible')){
alert("Node Expanded")
}
}
|
// Triggers when node is Expanded
onExpand(args){
alert("NodeExpanded");
}
//Triggers when node is collapsed
onCollapse(args){
alert("NodeCollapsed");
}
|