I am trying to use the run the example from the documenation page but it seems that the treegrid is not loading the data. The component version is "@syncfusion/ej2-angular-treegrid": "^18.3.40".
import { Component } from '@angular/core';
import { DataManager, WebApiAdaptor } from '@syncfusion/ej2-data';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'TTTestTreeGrid';
public data: DataManager;
ngOnInit(): void {
this.data = new DataManager({
url:
'https://ej2services.syncfusion.com/production/web-services/api/SelfReferenceData',
adaptor: new WebApiAdaptor(),
crossDomain: true,
offline: true,
});
console.log(this.data.dataSource)
}
}
<ejs-treegrid
[dataSource]="data"
[treeColumnIndex]="1"
parentIdMapping="ParentItem"
idMapping="TaskID"
[allowPaging]="true"
>
<e-columns>
<e-column
field="TaskID"
headerText="Task ID"
width="90"
textAlign="Right"
></e-column>
<e-column field="TaskName" headerText="Task Name" width="170"></e-column>
<e-column
field="StartDate"
headerText="Start Date"
width="130"
format="yMd"
textAlign="Right"
></e-column>
<e-column
field="Duration"
headerText="Duration"
width="80"
textAlign="Right"
></e-column>
</e-columns>
</ejs-treegrid>