App.component.html
<ejs-treegrid #treegrid [dataSource]='data' [editSettings]='editSettings' hasChildMapping='isParent' [toolbar]='toolbar' idMapping='TaskID' parentIdMapping='ParentID' (expanding)="Begin($event)" [treeColumnIndex]='1'>
<e-columns>
<e-column field='TaskID' headerText='Task ID' isPrimaryKey=true width='150'></e-column>
<e-column field='TaskName' headerText='Task Name' width='150'></e-column>
</e-columns>
</ejs-treegrid>
App.component.ts
ngOnInit(): void {
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: "Row" };
this.toolbar = ["Add", "Edit", "Delete", "Update", "Cancel"];
. . .
});
}
Begin = function (args: any) {
var treeGridObj = document.getElementsByClassName('e-treegrid')[0].ej2_instances;
treeGridObj[0].grid.query.addParams("data", args.data.TaskID);
}
|