In app.component.html
<ejs-treegrid #treegrid (load)='load($event)' [dataSource]='data' childMapping='subtasks' [treeColumnIndex]='0' [columns]="treegridColumns">
</ejs-treegrid>
<ng-template let-data #template1>
<button ejs-button>Button</button>
</ng-template>
In app.component.ts
ngAfterViewInit(){
this.treegridColumns = [{ field: "taskID", isPrimaryKey: "true", headerText: "Task ID", width: "90" },
{ headerText: "taskName", width: "90", template: this.temp1}];
}
load(args: any): void {
var tree = this.treegrid
this.treegrid.grid.load = function(args){
this['viewContainerRef'] = tree['viewContainerRef'];
}
|
how can i add dynamic hyperlinks to the tree grid, the hyperlinks should be updated based on the row data
App.Component.html:-
<ejs-treegrid
#treegrid
[dataSource] = "data"
childMapping = "subtasks"
height = "350"
[treeColumnIndex] = "0"
[allowPaging] = "true"
[pageSettings] = "pageSettings"
>
<e-columns>
<e-column
field="taskID"
headerText="Task ID"
width="150"
textAlign="Right"
></e-column>
<e-column field="taskName" headerText="Task Name" width="200">
<ng-template #template let-data>
<div class="url">
<a rel='nofollow' href="https://ej2.syncfusion.com/documentation/{{ data.taskName}}">{{data.taskName}}</a>
</div>
</ng-template>
</e-column>
</e-columns>
</ejs-treegrid> |